Skip to content

Commit

Permalink
Use 'help_functions.R' file
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jul 17, 2024
1 parent 0ad7da0 commit 4188886
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
File renamed without changes.
14 changes: 1 addition & 13 deletions scripts/check_all_chapters_code_impl.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@ if (!stringr::str_detect(pwd, "bevy_tdd_book$")) {
}
}

source("scripts/helper_functions.R")

/*
get_all_chapter_filenames <- function() {
all_md_files <- list.files(pattern = "md")
md_files <- stringr::str_subset(all_md_files, "[A-Z]", negate = TRUE)
md_files <- stringr::str_subset(md_files, "faq.md", negate = TRUE)
md_files <- stringr::str_subset(md_files, "definitions.md", negate = TRUE)
md_files <- stringr::str_subset(md_files, "introduction.md", negate = TRUE)
md_files <- stringr::str_subset(md_files, "functions.md", negate = TRUE)
md_files
}
*/
source(file.path("scripts/helper_functions.R"))

chapter_filenames <- get_all_chapter_filenames()

Expand Down
10 changes: 0 additions & 10 deletions scripts/clone_all_chapters_impl.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ source("scripts/helper_functions.R")

md_files <- get_all_chapter_filenames()

/*
all_md_files <- list.files(pattern = "md")
md_files <- stringr::str_subset(all_md_files, "[A-Z]", negate = TRUE)
md_files <- stringr::str_subset(md_files, "faq.md", negate = TRUE)
md_files <- stringr::str_subset(md_files, "definitions.md", negate = TRUE)
md_files <- stringr::str_subset(md_files, "introduction.md", negate = TRUE)
md_files <- stringr::str_subset(md_files, "functions.md", negate = TRUE)
md_files
*/

chapter_names <- stringr::str_sub(md_files, end = -4)

message(paste0("Going up one folder"))
Expand Down
2 changes: 1 addition & 1 deletion scripts/helper_functions.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

get_all_chapter_filenames <- function() {
if (!stringr::str_detect(pwd, "bevy_tdd_book$")) {
if (!stringr::str_detect(getwd(), "bevy_tdd_book$")) {
stop("Run this script in the 'bevy_tdd_book' folder")
}

Expand Down

0 comments on commit 4188886

Please sign in to comment.