From 7a3911dd8983741e121ed58ee767f2c67ebc8e6a Mon Sep 17 00:00:00 2001 From: Pingfan Hu Date: Thu, 22 Aug 2024 12:36:34 -0400 Subject: [PATCH] update other jhelvy to surveydown-ext --- R/templates.R | 18 +++++++++--------- man/sd_update_extension.Rd | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/R/templates.R b/R/templates.R index cfac8f37..89c016b9 100644 --- a/R/templates.R +++ b/R/templates.R @@ -45,16 +45,16 @@ sd_create_survey <- function(path = getwd(), template = "simple") { } } - target_surveydown_path <- file.path(path, "_extensions", "jhelvy", "surveydown") + target_surveydown_path <- file.path(path, "_extensions", "surveydown-dev", "surveydown") if (dir.exists(target_surveydown_path)) { unlink(target_surveydown_path, recursive = TRUE) } - target_jhelvy_path <- file.path(path, "_extensions", "jhelvy") - dir.create(target_jhelvy_path, recursive = TRUE, showWarnings = FALSE) + target_surveydown_dev_path <- file.path(path, "_extensions", "surveydown-dev") + dir.create(target_surveydown_dev_path, recursive = TRUE, showWarnings = FALSE) - source_surveydown_path <- file.path(unzipped_dir, "_extensions", "jhelvy", "surveydown") - file.copy(source_surveydown_path, target_jhelvy_path, recursive = TRUE) + source_surveydown_path <- file.path(unzipped_dir, "_extensions", "surveydown-dev", "surveydown") + file.copy(source_surveydown_path, target_surveydown_dev_path, recursive = TRUE) items_to_move <- list.files(unzipped_dir, all.files = TRUE, full.names = TRUE, no.. = TRUE) items_to_move <- items_to_move[!grepl("_extensions", items_to_move)] @@ -78,7 +78,7 @@ sd_create_survey <- function(path = getwd(), template = "simple") { #' Update Survey Extension #' -#' This function updates or creates the _extensions/jhelvy/surveydown folder +#' This function updates or creates the _extensions/surveydown-dev/surveydown folder #' with the latest contents from the surveydown-ext repository. #' #' @param path A character string specifying the directory in which to update @@ -102,8 +102,8 @@ sd_update_extension <- function(path = getwd()) { dir.create(temp_dir) unzipped_dir <- download_extension(temp_dir) - source_path <- file.path(unzipped_dir, "_extensions", "jhelvy", "surveydown") - target_path <- file.path(path, "_extensions", "jhelvy", "surveydown") + source_path <- file.path(unzipped_dir, "_extensions", "surveydown-dev", "surveydown") + target_path <- file.path(path, "_extensions", "surveydown-dev", "surveydown") if (dir.exists(target_path)) { unlink(list.files(target_path, full.names = TRUE), recursive = TRUE) @@ -127,7 +127,7 @@ sd_update_extension <- function(path = getwd()) { #' @return A character string with the path to the unzipped directory. #' @keywords internal download_extension <- function(temp_dir) { - repo_url <- "https://github.com/jhelvy/surveydown-ext/archive/refs/heads/main.zip" + repo_url <- "https://github.com/surveydown-dev/surveydown-ext/archive/refs/heads/main.zip" temp_file <- tempfile(fileext = ".zip") utils::download.file(repo_url, temp_file, mode = "wb") diff --git a/man/sd_update_extension.Rd b/man/sd_update_extension.Rd index 0a03d718..3e7032ee 100644 --- a/man/sd_update_extension.Rd +++ b/man/sd_update_extension.Rd @@ -14,7 +14,7 @@ or create the extension. Defaults to the current working directory.} Invisibly returns TRUE if the extension was successfully updated. } \description{ -This function updates or creates the _extensions/jhelvy/surveydown folder +This function updates or creates the _extensions/surveydown-dev/surveydown folder with the latest contents from the surveydown-ext repository. } \details{