Skip to content

Commit

Permalink
Use fs package to deterimine abs paths
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Jan 7, 2025
1 parent 434f6e3 commit f1f3696
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Imports:
stringr,
methods,
rlang,
fs,
rstudioapi (>= 0.11)
RoxygenNote: 7.3.2
Suggests:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export(stage_here)
exportClasses(dsoParams)
exportMethods(as.list)
exportMethods(show)
importFrom(fs,is_absolute_path)
importFrom(glue,glue)
importFrom(here,here)
importFrom(here,i_am)
Expand Down
3 changes: 2 additions & 1 deletion R/read_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ set_stage <- function(stage_path) {
#' Should an absolute path be provided to stage_here(), the path remains unchanged.
#' @param ... additional parts of the path appended to the stage path using `file.path`
#' @export
#' @importFrom fs is_absolute_path
#' @return absolute path to stage
stage_here <- function(...) {
# do not change absolute paths
if (str_starts(file.path(...), "/")) {
if (is_absolute_path(file.path(...))) {
file.path(...)
} else {
file.path(config_env$stage_dir, ...)
Expand Down
1 change: 1 addition & 0 deletions man/stage_here.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f1f3696

Please sign in to comment.