Skip to content

Commit

Permalink
Fixing setwd v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusmmp committed Mar 18, 2021
1 parent c8cb59a commit 94a4362
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/exams2sakai.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,15 @@ exams2sakai <- function(file, n = 1L, nsamp = NULL, dir = ".",
## compress
if(zip) {
owd <- getwd()
on.exit(setwd(owd), add = TRUE)
setwd(test_dir)
utils::zip(zipfile = zipname <- paste(name, "zip", sep = "."), files = list.files(test_dir))
setwd(owd)
} else zipname <- list.files(test_dir)

if(dir == ".") {
dir = owd
}

## copy the final .zip file
file.copy(file.path(test_dir, zipname), dir, recursive = TRUE)

Expand Down

0 comments on commit 94a4362

Please sign in to comment.