Skip to content

Commit

Permalink
refactor: Write out legacy entrypoint cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilzyla committed Jan 30, 2024
1 parent eaa257e commit d1f3499
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions R/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,28 @@ app <- function() {

entrypoint <- read_config()$legacy_entrypoint
if (identical(entrypoint, "app_dir")) {
return(shiny::shinyAppDir("app"))
}

if (identical(entrypoint, "source")) {
shiny::shinyAppDir("app")
} else if (identical(entrypoint, "source")) {
main <- new.env()
source(fs::path("app", "main.R"), local = main)
} else {
shiny::shinyApp(
ui = with_head_tags(main$ui),
server = main$server
)
} else if (identical(entrypoint, "box_top_level")) {
main <- load_main_module()
if (!identical(entrypoint, "box_top_level")) {
main <- as_top_level(main)
}
shiny::shinyApp(
ui = with_head_tags(main$ui),
server = main$server
)
} else if (is.null(entrypoint)) {
main <- load_main_module()
main <- as_top_level(main)
shiny::shinyApp(
ui = with_head_tags(main$ui),
server = main$server
)
} else {
stop()
}
shiny::shinyApp(
ui = with_head_tags(main$ui),
server = main$server
)
}

0 comments on commit d1f3499

Please sign in to comment.