Skip to content

Commit

Permalink
Update template dcf and function param
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbharti committed Sep 30, 2024
1 parent e41a34b commit b6234fb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions R/init_shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
#' #proj_shiny_init()
#'
#' @export
init_shiny <- function(path = getwd(), confirm = FALSE){
init_shiny <- function(path = getwd(), confirm = TRUE){


# Display a message before the prompt
cat("You current working directory will be:\n")
cat(path)

if(confirm){
user_input <- "y"
}else{
user_input <- tolower(
readline(
prompt = "Do you wish to create a project template here? (y/yes to confirm): "
)
)
}else{
user_input <- "y"
}


Expand Down
6 changes: 3 additions & 3 deletions R/init_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
#'
#' @examples
#' init_template("shiny",getwd())
init_template <- function(template_name, path, confirm = FALSE) {
init_template <- function(template_name, path, confirm = TRUE) {

# Display a message before the prompt
cat("You current working directory will be:\n")
cat(path)

if(confirm){
user_input <- "y"
}else{
user_input <- tolower(
readline(
prompt = "Do you wish to create a project template here? (y/yes to confirm): "
)
)
}else{
user_input <- "y"
}

if (user_input %in% c("y", "yes")) {
Expand Down
4 changes: 3 additions & 1 deletion inst/rstudio/templates/project/init_shiny.dcf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Binding: init_shiny
Title: Peacock: Shiny Template
Subtitle: Create a new Shiny app project
Caption: Start a new Shiny project with pre-defined structure and files
Caption: Shiny project with pre-defined structure and files
Params:
confirm: FALSE
2 changes: 1 addition & 1 deletion man/init_shiny.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/init_template.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6234fb

Please sign in to comment.