From cf99879384c1ff425122f5c7a310677236a09961 Mon Sep 17 00:00:00 2001 From: mpadge Date: Tue, 5 Nov 2024 19:10:36 +0100 Subject: [PATCH] catch pkgs with no R dir in 'extract_tarball' --- DESCRIPTION | 2 +- R/extract-tarball.R | 6 +++++- codemeta.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 73aaed9..d500eb2 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: pkgstats Title: Metrics of R Packages -Version: 0.2.0.047 +Version: 0.2.0.048 Authors@R: person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2172-5265")) diff --git a/R/extract-tarball.R b/R/extract-tarball.R index f25cf9d..1fb3bbc 100644 --- a/R/extract-tarball.R +++ b/R/extract-tarball.R @@ -59,7 +59,11 @@ extract_tarball <- function (tarball) { rename_files_in_r <- function (path) { path <- fs::path_real (path) - f_sq <- fs::dir_ls (fs::path (path, "R"), regexp = "\\.(s|S|q)$") + path_r <- fs::path (path, "R") + if (!fs::dir_exists (path_r)) { + return (FALSE) + } + f_sq <- fs::dir_ls (path_r, regexp = "\\.(s|S|q)$") if (length (f_sq) > 0) { diff --git a/codemeta.json b/codemeta.json index c7094ef..9390286 100644 --- a/codemeta.json +++ b/codemeta.json @@ -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.047", + "version": "0.2.0.048", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R",