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

Fix windows zip problem in vignette #50

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ Imports: googledrive,
yaml,
stringr,
knitr (>= 1.33),
qpdf
qpdf,
Suggests:
remotes,
testthat
testthat,
downloader
Encoding: UTF-8
LazyData: true
Remotes: jhudsl/text2speech,
Expand Down
19 changes: 6 additions & 13 deletions R/example_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bad_quiz_path <- function() {
#' @param dest_dir The destination directory you would like the example repo files to be placed. By default is current directory.
#' @export
#'
#' @importFrom utils download.file
#' @importFrom downloader download
#' @importFrom utils unzip
#' @examples
#'
Expand All @@ -47,19 +47,12 @@ example_repo_setup <- function(dest_dir = ".") {
if (!dir.exists(dest_dir)) {
dir.create(dest_dir)
}
download.file(url = "https://github.com/jhudsl/DaSL_Course_Template_Leanpub/raw/main/example-repo.zip",
destfile = zip_file)
downloader::download(url = "https://github.com/jhudsl/DaSL_Course_Template_Leanpub/raw/main/example-repo.zip",
destfile = zip_file,
mode = "wb")

# See what unzip is being used
operating_system <- Sys.info()[1]
message(operating_system)
if (operating_system == "Windows" ){
# Unzip function doesn't always work for windows
system(paste("7z a -tzip", zip_file, dest_dir))
} else {
# Unzip the folder
utils::unzip(zip_file, exdir = dest_dir)
}
# Unzip the folder
utils::unzip(zip_file, exdir = dest_dir)
}

#' Clean up example repo files
Expand Down