Skip to content

Commit

Permalink
Explain why we don't just use normalizePath() when cleaning the path.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Aug 6, 2024
1 parent 64ae0c4 commit ea53c66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @import httr2
#' @import httr1
extract_error_message <- function(res) {
ct <- resp_content_type(res)
if (ct == "application/json") {
Expand All @@ -22,6 +22,10 @@ redirect_post <- function(req) {

#' @importFrom utils head
clean_path <- function(path) {
# Don't use normalizePath() here, as that may end up resolving symlinks
# that the user wanted to keep (e.g., for aliased drives). Rather, we do
# the bare minimum required to obtain a clean absolute path, analogous
# to Golang's filepath.Clean().
if (!startsWith(path, "/")) {
path <- paste0(getwd(), "/", path)
}
Expand Down

0 comments on commit ea53c66

Please sign in to comment.