diff --git a/.Rbuildignore b/.Rbuildignore index 7a0e1331..906ea877 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,5 +1,5 @@ ^data-raw$ -^.*\.Rproj$ +surveydown.Rproj ^\.Rproj\.user$ ^docs$ ^notes$ diff --git a/DESCRIPTION b/DESCRIPTION index 8f86c543..7b943fa1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,6 @@ Imports: markdown, readr, RPostgres, - rstudioapi, rvest, shiny, shinyjs, diff --git a/R/templates.R b/R/templates.R index 9b499a44..87b4e0b8 100644 --- a/R/templates.R +++ b/R/templates.R @@ -3,7 +3,7 @@ #' This function creates a survey template in a specified directory. It can use #' different templates, with `"simple"` being the default. The function prompts #' the user to confirm the use of the current working directory if no path is -#' specified. It also opens the new project in RStudio. +#' specified. #' #' @param path A character string specifying the directory in which to create #' the survey template. Defaults to the current working directory. @@ -52,12 +52,4 @@ create_survey <- function(path = getwd(), template = "simple") { file.copy(list.files(source_dir, full.names = TRUE), path, recursive = TRUE) usethis::ui_done(paste("Survey template created at", path)) - - # Change to the new project if running in RStudio - if (requireNamespace("rstudioapi", quietly = TRUE) && rstudioapi::isAvailable()) { - proj_file <- file.path(path, "survey.Rproj") - if (file.exists(proj_file)) { - rstudioapi::openProject(proj_file) - } - } } diff --git a/man/create_survey.Rd b/man/create_survey.Rd index 89a20cbd..8d3045d9 100644 --- a/man/create_survey.Rd +++ b/man/create_survey.Rd @@ -20,7 +20,7 @@ A message indicating the successful creation of the survey template. This function creates a survey template in a specified directory. It can use different templates, with \code{"simple"} being the default. The function prompts the user to confirm the use of the current working directory if no path is -specified. It also opens the new project in RStudio. +specified. } \examples{ \dontrun{