Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remvoe setwd() #165

Closed
chainsawriot opened this issue Sep 4, 2023 · 0 comments
Closed

Remvoe setwd() #165

chainsawriot opened this issue Sep 4, 2023 · 0 comments

Comments

@chainsawriot
Copy link
Collaborator

chainsawriot commented Sep 4, 2023

See gesistsa/rio#319

readODS/R/write_ods.R

Lines 8 to 19 in a81f54a

.zip_tmp_to_path <- function(temp_ods_dir, path, overwrite = TRUE, flat = FALSE) {
if (flat) {
return(path) ## do nothing
}
wd <- getwd()
on.exit(setwd(wd), add = TRUE)
setwd(temp_ods_dir)
zip::zip(basename(path), include_directories = FALSE, recurse = TRUE, files = dir(), mode = "cherry-pick")
setwd(wd)
file.copy(file.path(temp_ods_dir, basename(path)), path, overwrite = overwrite)
return(path)
}

chainsawriot added a commit that referenced this issue Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant