Skip to content

Commit

Permalink
fix detection of vignettes from #68
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Oct 23, 2024
1 parent 7a0b432 commit 05ab048
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pkgstats
Title: Metrics of R Packages
Version: 0.2.0.036
Version: 0.2.0.037
Authors@R:
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
14 changes: 10 additions & 4 deletions R/extra-stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ get_num_vignettes <- function (path) {

nv <- 0L

if ("build" %in% fs::dir_ls (path)) {
path_ls <- basename (fs::dir_ls (path))

if ("build" %in% path_ls) {

flist <- fs::dir_ls (fs::path (path, "build"),
full.names = TRUE
Expand All @@ -11,7 +13,7 @@ get_num_vignettes <- function (path) {
if (length (vfile) > 0) {
nv <- nrow (readRDS (vfile [1]))
}
} else if ("vignettes" %in% fs::dir_ls (path)) {
} else if ("vignettes" %in% path_ls) {
nv <- length (fs::dir_ls (
fs::path (path, "vignettes"),
regexp = "\\.[rR]md$"
Expand All @@ -31,7 +33,9 @@ get_num_demos <- function (path) {

nd <- 0L

if ("demo" %in% fs::dir_ls (path)) {
path_ls <- basename (fs::dir_ls (path))

if ("demo" %in% path_ls) {

dindex <- fs::path (path, "demo", "00Index")
nd <- length (brio::read_lines (dindex))
Expand All @@ -44,7 +48,9 @@ get_data_stats <- function (path) {

nd <- c (n = 0L, total_size = 0L, median_size = 0L)

if ("data" %in% fs::dir_ls (path)) {
path_ls <- basename (fs::dir_ls (path))

if ("data" %in% path_ls) {

flist <- fs::dir_ls (fs::path (path, "data"),
regexp = "\\.rd",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/pkgstats",
"issueTracker": "https://github.com/ropensci-review-tools/pkgstats/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.2.0.036",
"version": "0.2.0.037",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 05ab048

Please sign in to comment.