diff --git a/R/config.R b/R/config.R index e4a1989..185c97e 100644 --- a/R/config.R +++ b/R/config.R @@ -52,7 +52,8 @@ addConfig <- function(block, database = block, projectPath = here::here(), open check <- config_check() if (check) { - projName <- basename(projectPath) + projFile <- list.files(projectPath, pattern = ".Rproj", full.names = TRUE) + projName <- basename(tools::file_path_sans_ext(here::here(projFile))) cohortTable <- paste(projName, database, sep = "_") config_block_txt <- glue::glue( diff --git a/R/makeFiles.R b/R/makeFiles.R index b1df438..8c510a8 100644 --- a/R/makeFiles.R +++ b/R/makeFiles.R @@ -58,7 +58,8 @@ makeNews <- function(projectPath = here::here(), open = TRUE) { #' @export makeConfig <- function(block, database = block, projectPath = here::here(), open = TRUE) { - projName <- basename(projectPath) + projFile <- list.files(projectPath, pattern = ".Rproj", full.names = TRUE) + projName <- basename(tools::file_path_sans_ext(here::here(projFile))) data <- rlang::list2( 'Project' = projName,