Skip to content

Commit

Permalink
feat: Add ide_open_app() (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Jan 27, 2025
1 parent 0110900 commit 3c9b985
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Description: Core shiny team tools to facilitate testing of the shiny-verse.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Imports:
jsonlite,
progress,
Expand Down
22 changes: 22 additions & 0 deletions R/test-in-ide.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,25 @@ test_in_ide <- function(
}
)
}

ide_open_app <- function(app_name) {
app_name <- resolve_app_name(app_name)
owd <- setwd(app_path(app_name))
cli::cli_alert("Opening app {.field {app_name}}")
cli::cli_alert_info("App location: {.path {app_path(app_name)}}")

app_files <- dir(pattern = "(app|ui).[Rr]")
server_files <- dir(pattern = "server.[Rr]")
test_files <- dir("tests/testthat", pattern = "test-", full.names = TRUE)

files <- vapply(
c(app_files, server_files, test_files),
function(x) sprintf("{.path %s}", x),
character(1)
)

cli::cli_h3("Test app files")
cli::cli_ol(files)

invisible(owd)
}

0 comments on commit 3c9b985

Please sign in to comment.