Skip to content

Commit

Permalink
separate 'identidy_older_files' fn in gh-pages.R
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Aug 27, 2024
1 parent f799554 commit a709ddd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: roreviewapi
Title: Plumber API to report package structure and function
Version: 0.1.0.051
Version: 0.1.0.052
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
50 changes: 27 additions & 23 deletions R/gh-pages.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,7 @@ push_to_gh_pages <- function (check) {
files <- gsub (rorev_dir, "", unlist (files))
files <- gsub (paste0 ("^", .Platform$file.sep), "", files)

# rm any older files:
older_files <- NULL
if ("network_file" %in% names (attributes (check))) {

older_files <- gsub (
"\\.html$",
"",
fs::path_file (attr (check, "network_file"))
)
}

if ("srr_report_file" %in% names (attributes (check))) {

older_files <- c (
older_files,
gsub (
"\\.html$",
"",
basename (attr (check, "srr_report_file"))
)
)
}

older_files <- identify_older_files (check)
older_files <- older_files [which (!grep (this_hash, older_files))]

index <- lapply (older_files, function (i) grep (i, git_files))
Expand Down Expand Up @@ -233,3 +211,29 @@ get_pkg_hash <- function (check, out) {

return (this_hash)
}

identify_older_files <- function (check) {
older_files <- NULL
if ("network_file" %in% names (attributes (check))) {

older_files <- gsub (
"\\.html$",
"",
fs::path_file (attr (check, "network_file"))
)
}

if ("srr_report_file" %in% names (attributes (check))) {

older_files <- c (
older_files,
gsub (
"\\.html$",
"",
basename (attr (check, "srr_report_file"))
)
)
}

return (older_files)
}
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/roreviewapi",
"issueTracker": "https://github.com/ropensci-review-tools/roreviewapi/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.0.051",
"version": "0.1.0.052",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit a709ddd

Please sign in to comment.