Skip to content

Commit

Permalink
add launch.browser option to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Oct 2, 2013
1 parent bfdd16d commit d2c952f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
19 changes: 14 additions & 5 deletions R/deploy.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
#' Deploy an application to ShinyApps
#'
#' Deploy an application to ShinyApps
#' @param appDir Directory containing application source code (defaults to
#' @param appDir Directory containing application source code (defaults to
#' current working directory)
#' @param appName Name of application (names must be unique with ShinyApps
#' accounts)
#' @param account ShinyApps account to deploy application to. This parameter is
#' only required for the initial deployment of an application when there are
#' accounts)
#' @param account ShinyApps account to deploy application to. This parameter is
#' only required for the initial deployment of an application when there are
#' multiple accounts configured on the system.
#' @param quiet Request that no status information be printed to the console
#' @param launch.browser If true, the system's default web browser will be
#' launched automatically after the app is started. Defaults to true in
#' interactive sessions only.
#' @param quiet Request that no status information be printed to the console
#' during the deployment.
#' @export
deploy <- function(appDir = getwd(),
appName = NULL,
account = NULL,
launch.browser = getOption("shinyapps.launch.browser",
interactive()),
quiet = FALSE) {

if (!isStringParam(appDir))
Expand Down Expand Up @@ -70,6 +75,10 @@ deploy <- function(appDir = getwd(),
bundle$id,
application$url)

# launch the browser if requested
if (launch.browser)
utils::browseURL(application$url)

# successful deployment!
invisible(TRUE)
}
Expand Down
5 changes: 5 additions & 0 deletions man/deploy.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
\title{Deploy an application to ShinyApps}
\usage{
deploy(appDir = getwd(), appName = NULL, account = NULL,
launch.browser = getOption("shinyapps.launch.browser", interactive()),
quiet = FALSE)
}
\arguments{
Expand All @@ -17,6 +18,10 @@
deployment of an application when there are multiple
accounts configured on the system.}

\item{launch.browser}{If true, the system's default web
browser will be launched automatically after the app is
started. Defaults to true in interactive sessions only.}
\item{quiet}{Request that no status information be
printed to the console during the deployment.}
}
Expand Down

0 comments on commit d2c952f

Please sign in to comment.