From 49d1b37bf4a93437063a1f96efff98bd93bdf4df Mon Sep 17 00:00:00 2001 From: aheinri5 <Anna@netzkritzler.de> Date: Mon, 8 Mar 2021 12:57:04 +0100 Subject: [PATCH] [feature] WIP: function to download OGS6 --- R/download_ogs6.R | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 R/download_ogs6.R diff --git a/R/download_ogs6.R b/R/download_ogs6.R new file mode 100644 index 0000000..c1beeea --- /dev/null +++ b/R/download_ogs6.R @@ -0,0 +1,41 @@ + + +#' Download OpenGeoSys 6 +#' +#' Downloads latest prebuilt OpenGeoSys 6 version +#' +#' @param path String: Download path. Defaults to ... +#' @param os String: Operating System. +#' @export +ogs6_download_ogs6 <- function(path, os){ + + if(missing(path)){ + path <- dirname(unlist(options("r2ogs6.default_ogs6_bin_path"))) + } + + if(missing(os)){ + os <- Sys.info()["sysname"] + } + + assertthat::assert_that(assertthat::is.string(path)) + assertthat::assert_that(assertthat::is.string(os)) + + if(os == "Windows"){ + + windows_dl_path <- + paste0( + "https://ogsstorage.blob.core.windows.net/binaries/ogs6/", + "6.3.3/ogs-6.3.3-Windows-10.0.14393-python-3.7.2-utils.zip" + ) + + zip_path <- paste0(path, ".zip") + + download.file(windows_dl_path, zip_path) + unzip(zip_path, exdir = dirname(path)) + unlink(zip_path) + }else{ + + } + + return(invisible) +} -- GitLab