Skip to content

Commit

Permalink
enable tilde expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbarks committed Oct 4, 2023
1 parent e57da22 commit e7a6bcb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/decrypt_wb.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ decrypt_wb <- function(path,
password,
path_out = tempfile(fileext = get_ext(path))) {

# python fns used below don't perform tilde expansion by default
path <- path.expand(path)
path_out <- path.expand(path_out)

if (!get_ext(path) %in% c(".xlsx", ".xlsb")) {
stop("Argument `path` must have extension .xlsx or .xlsb")
Expand All @@ -31,7 +34,7 @@ decrypt_wb <- function(path,
stop("Arguments `path` and `path_out` do not have the same extension")
}

if (normalizePath(path, mustWork = FALSE) == normalizePath(path_out, mustWork = FALSE)) {
if (path == path_out) {
stop("Arguments `path` and `path_out` must not be the same")
}

Expand Down

0 comments on commit e7a6bcb

Please sign in to comment.