Skip to content

Commit

Permalink
pload supports github pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangchuangYu committed Nov 6, 2024
1 parent af16a53 commit 1c0f82d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: yulab.utils
Title: Supporting Functions for Packages Maintained by 'YuLab-SMU'
Version: 0.1.7.001
Version: 0.1.7.002
Authors@R: c(person("Guangchuang", "Yu", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6485-8781")))
Description: Miscellaneous functions commonly used by 'YuLab-SMU'.
Imports:
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# yulab.utils 0.1.7.001
# yulab.utils 0.1.7.002

+ `pload()` now supports github package (2024-11-06, Wed)
+ bug fixed in `pkg_ref()` (2024-08-26, Mon)

# yulab.utils 0.1.7
Expand Down
3 changes: 2 additions & 1 deletion R/pkg-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ pload <- function(package, action = "auto") {
if (action == "auto") {
if (is.installed("BiocManager")) {
install <- getFromNamespace("install", "BiocManager")
action <- function(package, ask=FALSE, update=FALSE, ...){
action <- function(package, ask=FALSE, update=FALSE, ...) {
install(package, ask=ask, update = update, ...)
}
} else {
action <- NULL
}
}
check_installed(pkg, action = action)
pkg <- sub("\\w+/", "", pkg) # for github pkg: repo/pkg
cli::cli_h2(sprintf("loading the package: %s", pkg))
library(pkg, character.only = TRUE)
}
Expand Down

0 comments on commit 1c0f82d

Please sign in to comment.