From a85ffce243aa728b2f7ab991f4294dbfd1c4d198 Mon Sep 17 00:00:00 2001 From: Lukas Pietzschmann Date: Sun, 3 Nov 2024 11:00:52 +0100 Subject: [PATCH 1/2] Don't overwrite filetoken if it is passed manually --- R/file_analysis.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/file_analysis.R b/R/file_analysis.R index b1fc579..745ab58 100644 --- a/R/file_analysis.R +++ b/R/file_analysis.R @@ -24,7 +24,6 @@ request_file_analysis <- function(con, if (!rlang::is_missing(filepath)) { stopifnot(is.character(filepath) || is.vector(filepath)) filepath <- normalizePath(filepath, mustWork = FALSE) - filetoken <- get_filetoken(filepath) request <- list( type = "request-file-analysis", id = id, From 111189d8899656a188fedc9ae5737d08e420fb32 Mon Sep 17 00:00:00 2001 From: Lukas Pietzschmann Date: Sun, 3 Nov 2024 11:05:21 +0100 Subject: [PATCH 2/2] Normalizing the paths can't hurt --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 2b104cb..d40d5e8 100644 --- a/R/utils.R +++ b/R/utils.R @@ -19,7 +19,7 @@ get_filetoken <- function(filepath = rlang::missing_arg(), content = rlang::miss if (!rlang::is_missing(filepath)) { stopifnot(is.character(filepath) || is.vector(filepath)) # sort to ensure that a different order will result in the same token - filepath <- sort(c(filepath)) + filepath <- sort(lapply(c(filepath), normalizePath) |> unlist()) stopifnot(file.exists(filepath)) token <- digest::digest(lapply(filepath, readLines)) } else if (!rlang::is_missing(content)) {