Skip to content

Commit 3c9b985

Browse files
authored
feat: Add ide_open_app() (#281)
1 parent 0110900 commit 3c9b985

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Description: Core shiny team tools to facilitate testing of the shiny-verse.
1010
License: MIT + file LICENSE
1111
Encoding: UTF-8
1212
Roxygen: list(markdown = TRUE)
13-
RoxygenNote: 7.3.1
13+
RoxygenNote: 7.3.2
1414
Imports:
1515
jsonlite,
1616
progress,

R/test-in-ide.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,25 @@ test_in_ide <- function(
186186
}
187187
)
188188
}
189+
190+
ide_open_app <- function(app_name) {
191+
app_name <- resolve_app_name(app_name)
192+
owd <- setwd(app_path(app_name))
193+
cli::cli_alert("Opening app {.field {app_name}}")
194+
cli::cli_alert_info("App location: {.path {app_path(app_name)}}")
195+
196+
app_files <- dir(pattern = "(app|ui).[Rr]")
197+
server_files <- dir(pattern = "server.[Rr]")
198+
test_files <- dir("tests/testthat", pattern = "test-", full.names = TRUE)
199+
200+
files <- vapply(
201+
c(app_files, server_files, test_files),
202+
function(x) sprintf("{.path %s}", x),
203+
character(1)
204+
)
205+
206+
cli::cli_h3("Test app files")
207+
cli::cli_ol(files)
208+
209+
invisible(owd)
210+
}

0 commit comments

Comments
 (0)