Skip to content

Commit

Permalink
Do not change absolute paths in stage_here
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Jan 7, 2025
1 parent 550d921 commit 434f6e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/read_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,15 @@ set_stage <- function(stage_path) {
#' Get the absolute path to the current stage. The current stage can be set using set_stage()
#' by providing the relative path of the stage from the project root directory.
#' to the stage dir.
#' 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
#' @return absolute path to stage
stage_here <- function(...) {
file.path(config_env$stage_dir, ...)
# do not change absolute paths
if (str_starts(file.path(...), "/")) {
file.path(...)
} else {
file.path(config_env$stage_dir, ...)
}
}

0 comments on commit 434f6e3

Please sign in to comment.