Skip to content

Commit

Permalink
update search string for app.R file in setting dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherMarais committed Feb 25, 2024
1 parent bfd60e0 commit 91303d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ find_directory_of_file <- function(file_name, start_dir=getwd()) {

# find file_name from current working directory
# before trying from a shallower directory
file_name <- "*app.R" # The file you are searching for
file_name <- "*/app.R" # The file you are searching for

try({
found_dir <- find_directory_of_file(file_name)
# Check if found_dir is NULL or empty, indicating the file was not found
if (is.null(found_dir) || length(found_dir) == 0) {
# print error
print("app.R not found from current working directory!")
print("/app.R not found from current working directory!")
print("trying again from shallower directory")
# trying again from great grandparent directory of working directory
setwd("../../..")
Expand Down

0 comments on commit 91303d0

Please sign in to comment.