Skip to content

Commit

Permalink
Try to normalize getwd() as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
MLopez-Ibanez committed Jan 6, 2024
1 parent b198b1d commit 005e1d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/multi_irace.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ multi_irace <- function(scenarios, parameters, n = 1L, parallel = 1, split_outpu
scenarios[[i]]$execDir <- execDir
fs::dir_create(execDir)

if (logFile_old != '') {
if (nzchar(logFile_old)) {
logFile <- if (is.sub.path(logFile_old, execDir_old)) {
# 'logFile' is located in the old 'execDir', so move it into the new 'execDir'.
# 'path/to/execDir/logFile.rdata' -> 'path/to/execDir/run_{i}/logFile.rdata'.
Expand Down
6 changes: 2 additions & 4 deletions R/path_rel2abs.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
#' @export
path_rel2abs <- function (path, cwd = getwd())
{
# There is no need to normalize cwd if it was returned by getwd()
if (!missing(cwd))
cwd <- fs::path_expand(cwd)
cwd <- fs::path_norm(fs::path_expand(cwd))

if (fs::is_absolute_path(path)) {
# Possibly expand ~/path to /home/user/path.
path <- fs::path_expand(path)
} else {
} else if (!startsWith(path, ".")) {
# it may be a command in the path.
sys_path <- suppressWarnings(Sys.which(path))
if (nzchar(sys_path)
Expand Down

0 comments on commit 005e1d8

Please sign in to comment.