Skip to content

Commit 11381ea

Browse files
committed
Revert "Replace repo_dir in other files as well"
This reverts commit 527fddd.
1 parent 527fddd commit 11381ea

File tree

11 files changed

+17
-26
lines changed

11 files changed

+17
-26
lines changed

R/accept_snaps.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#' @inheritParams fix_snaps
66
#' @export
77
accept_snaps <- function(
8-
repo_dir = rprojroot::find_package_root_file()
8+
repo_dir = "."
99
) {
1010

1111
app_paths <- repo_apps_paths(repo_dir)
@@ -32,7 +32,7 @@ accept_snaps <- function(
3232

3333

3434
# Removes all snaps that are below the minimum R version
35-
remove_snaps_cruft <- function(repo_dir = rprojroot::find_package_root_file(), min_r_version = "3.6") {
35+
remove_snaps_cruft <- function(repo_dir = ".", min_r_version = "3.6") {
3636
app_paths <- repo_apps_paths(repo_dir)
3737

3838
pb <- progress_bar(

R/apps.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ is_manual_app <- function(app_dir) {
4646

4747

4848
### Start GHA
49-
apps_with_tests <- function(repo_dir = rprojroot::find_package_root_file()) {
49+
apps_with_tests <- function(repo_dir = ".") {
5050
basename(Filter(x = repo_apps_paths(repo_dir), has_tests_folder))
5151
}
52-
repo_apps_path <- function(repo_dir = rprojroot::find_package_root_file()) {
52+
repo_apps_path <- function(repo_dir = ".") {
5353
file.path(repo_dir, "inst", "apps")
5454
}
55-
repo_apps_paths <- function(repo_dir = rprojroot::find_package_root_file()) {
55+
repo_apps_paths <- function(repo_dir = ".") {
5656
dir(repo_apps_path(repo_dir), pattern = "^\\d\\d\\d-", full.names = TRUE)
5757
}
58-
repo_app_path <- function(app_name, repo_dir = rprojroot::find_package_root_file()) {
58+
repo_app_path <- function(app_name, repo_dir = ".") {
5959
file.path(repo_apps_path(repo_dir), app_name)
6060
}
6161

R/fix_snaps.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fix_snaps <- function(
2929
ask_apps = FALSE,
3030
ask_branches = TRUE,
3131
ask_if_not_main = TRUE,
32-
repo_dir = rprojroot::find_package_root_file()
32+
repo_dir = "."
3333
) {
3434
original_sys_call <- sys.call()
3535
ask_apps <- as.logical(ask_apps)
@@ -38,9 +38,6 @@ fix_snaps <- function(
3838
# validate_core_pkgs()
3939

4040
apps_folder <- file.path(repo_dir, "inst", "apps")
41-
if (!dir.exists(apps_folder)) {
42-
stop("Apps folder does not exist: ", apps_folder)
43-
}
4441

4542
verify_if_not_main_branch(ask_if_not_main, repo_dir = repo_dir)
4643
verify_no_git_changes(repo_dir = repo_dir, apps_folder = apps_folder)
@@ -278,7 +275,7 @@ fix_snaps <- function(
278275
f = function(app_name) {
279276
pb$tick(tokens = list(name = app_name))
280277
# Use `.` as `git_cmd_` runs within `repo_dir`
281-
app_path <- repo_app_path(repo_dir = rprojroot::find_package_root_file(), app_name = app_name)
278+
app_path <- repo_app_path(repo_dir = ".", app_name = app_name)
282279
git_cmd_("git checkout -- ", app_path)
283280
git_cmd_("git clean -df -- ", app_path)
284281
}
@@ -294,7 +291,7 @@ fix_snaps <- function(
294291

295292

296293
# Note: Logic should be duplicated in pre-check GHA workflow
297-
verify_no_new_snaps <- function(repo_dir = rprojroot::find_package_root_file(), folder = "inst/apps") {
294+
verify_no_new_snaps <- function(repo_dir = ".", folder = "inst/apps") {
298295
new_snaps <- dir(file.path(repo_dir, folder), pattern = "\\.new", recursive = TRUE, include.dirs = FALSE)
299296
if (length(new_snaps) > 0) {
300297
message("There should be no `.new` _snaps in `", folder, "`. Found: \n", paste0("* ", new_snaps, collapse = "\n"))

R/save-test-results.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' @inheritParams test_in_local
1111
#' @rdname test-results
1212
#' @export
13-
save_test_results <- function(output, gha_branch_name, pr_number, username, repo_dir = rprojroot::find_package_root_file()) {
13+
save_test_results <- function(output, gha_branch_name, pr_number, username, repo_dir = ".") {
1414
if (!inherits(output, "shinycoreci_test_output")) {
1515
stop("`output` must be an object returned by test_in_local()", call. = FALSE)
1616
}

R/test-in-local.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test_in_local <- function(
2323
assert = TRUE,
2424
timeout = 10 * 60,
2525
retries = 2,
26-
repo_dir = rprojroot::find_package_root_file()
26+
repo_dir = "."
2727
) {
2828
retries <- as.numeric(retries)
2929
repo_dir <- normalizePath(repo_dir, mustWork = TRUE)

R/view-test-images.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' @param repo_dir directory to the shinycoreci repo
44
#' @export
5-
view_test_images <- function(repo_dir = rprojroot::find_package_root_file()) {
5+
view_test_images <- function(repo_dir = ".") {
66
app_folders <- Filter(repo_apps_paths(repo_dir), f = function(app_folder) {
77
dir.exists(file.path(app_folder, "tests/testthat/_snaps"))
88
})

man/accept_snaps.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fix_snaps.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/test-results.Rd

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/test_in_local.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)