From d6f25aa4f0870d0d8ffd15745036b7c2282719de Mon Sep 17 00:00:00 2001 From: "Languillaume, Antoine" <antoine.languillaume@wur.nl> Date: Mon, 12 Oct 2020 14:32:27 +0200 Subject: [PATCH] Add script to download project --- download_project.R | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 download_project.R diff --git a/download_project.R b/download_project.R new file mode 100644 index 0000000..2b8a352 --- /dev/null +++ b/download_project.R @@ -0,0 +1,20 @@ +### Download and unzip project on user's computer + +current_wd <- getwd() + +url_repo <- paste0("https://git.wageningenur.nl/langu001/PPS_data_management/-/archive/", + "refactor/PPS_data_management-refactor.zip") +download.file(url = url_repo, + destfile = file.path(current_wd, "project.zip")) + +unzip("project.zip") + +list_files <- list.files("./PPS_data_management-refactor/", + full.names = TRUE) +file.copy(from = list_files, + to = "./", + recursive = TRUE) + +unlink("project.zip") +unlink(file.path(current_wd, "./PPS_data_management-refactor/"), + recursive = TRUE) -- GitLab