Skip to content

Commit

Permalink
Merge pull request #30 from RobLBaker/main
Browse files Browse the repository at this point in the history
dynamically get github username
  • Loading branch information
RobLBaker authored Jan 2, 2024
2 parents 2ac0714 + 3fdbacd commit 0ba73ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/updateR.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
"DPchecker",
"NPSutils",
"EMLassemblyline")

pkg_update <- remotes::package_deps(git_pkgs, dependencies = c("Imports",
"Remotes",
"Suggests"))
if(any(pkg_update$diff > 0)){

if(any(pkg_update$diff < 0)){
old_pkgs <- NULL
old_users <- NULL
for(i in seq_along(pkg_update$diff)){
if(pkg_update$diff[i] != 0){
if(pkg_update$diff[i] < 0){
old_pkgs <- append(old_pkgs, pkg_update$package[i])
old_users <- append(old_users, pkg_update$remote[[i]]$username)
}
}
load_header <- cli::rule(
Expand All @@ -31,7 +35,7 @@
cli::cli_text(
"{.strong To update {cli::qty(length(old_pkgs))}th{?is/ese} {cli::qty(length(old_pkgs))}package{?s}, please run:\n}")
cli::cat_line("detach_NPSdataverse()")
cli::cat_line("devtools::install_github(\"nationalparkservice/", old_pkgs, "\")")
cli::cat_line("devtools::install_github(\"", old_users, "/", old_pkgs, "\")")
cli::cat_line("\nClose R and Rstudio. Open a new R session and reload the NPSdataverse.")
cli::cat_line()
}
Expand Down

0 comments on commit 0ba73ae

Please sign in to comment.