Skip to content

Commit

Permalink
exclude readme and .gitignore from created template surveya
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed Aug 8, 2024
1 parent ed36f04 commit ad444af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/templates.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ sd_create_survey <- function(path = getwd(), template = "simple") {
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)]

# Exclude README.md and .gitignore
exclude_files <- c("README.md", ".gitignore")
items_to_move <- items_to_move[!basename(items_to_move) %in% exclude_files]

for (item in items_to_move) {
if (dir.exists(item)) {
file.copy(item, path, recursive = TRUE)
Expand Down

0 comments on commit ad444af

Please sign in to comment.