From 4a3ab1cb8d78c7ca4b967dcf62250310ede8b5dd Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 23 Feb 2023 08:20:21 -0600 Subject: [PATCH 1/9] WIP --- R/deployApp.R | 40 ++++++++++---------- R/deployDoc.R | 61 ++++++++++++++++++------------ tests/testthat/_snaps/deployDoc.md | 8 ++++ tests/testthat/test-deployDoc.R | 43 +++++++++++++++++++++ 4 files changed, 107 insertions(+), 45 deletions(-) create mode 100644 tests/testthat/_snaps/deployDoc.md create mode 100644 tests/testthat/test-deployDoc.R diff --git a/R/deployApp.R b/R/deployApp.R index 8d462e01..ffd774ce 100644 --- a/R/deployApp.R +++ b/R/deployApp.R @@ -18,8 +18,9 @@ #' control to ensure that future you and other collaborators will publish #' to the same location. #' -#' @param appDir Directory containing application. Defaults to current working -#' directory. +#' @param appDir Either a directory containing an application (e.g. a Shiny app +#' or plumber API) or a path to a document, like an `.html`, `.Rmd`, or +#' `.Qmd`. Defaults to the current working directory. #' @param appFiles A character vector given relative paths to the files and #' directories to bundle and deploy. The default, `NULL`, will include all #' files in `appDir`, apart from any listed in an `.rscignore` file. @@ -154,7 +155,23 @@ deployApp <- function(appDir = getwd(), condaMode <- FALSE - check_directory(appDir) + check_string(appDir) + if (dirExists(appDir)) { + # ok + } else if (file.exists(appDir) && isStaticFile(appDir)) { + doc <- standardizeSingleDocDeployment(appDir) + + appDir <- doc$appDir + appPrimaryDoc <- doc$appPrimaryDoc + if (is.null(appFiles) && is.null(appFileManifest)) { + appFiles <- doc$appFiles + } + } else { + cli::cli_abort( + "{.arg appDir} must be a directory or a .Rmd, .Qmd, or .html file" + ) + } + check_string(appName, allow_null = TRUE) # set up logging helpers @@ -207,23 +224,6 @@ deployApp <- function(appDir = getwd(), } } - # if a specific file is named, make sure it's an Rmd or HTML, and just deploy - # a single document in this case (this will call back to deployApp with a list - # of supporting documents) - rmdFile <- "" - if (!dirExists(appDir)) { - if (grepl("\\.[Rq]md$", appDir, ignore.case = TRUE) || - grepl("\\.html?$", appDir, ignore.case = TRUE)) { - return(deployDoc(appDir, appName = appName, appTitle = appTitle, - account = account, server = server, upload = upload, - recordDir = recordDir, launch.browser = launch.browser, - logLevel = logLevel, lint = lint)) - } else { - stop(appDir, " must be a directory, an R Markdown document, or an HTML ", - "document.") - } - } - # directory for recording deployment if (is.null(recordDir)) { recordDir <- appPath diff --git a/R/deployDoc.R b/R/deployDoc.R index 4ac13df5..5c1c37cc 100644 --- a/R/deployDoc.R +++ b/R/deployDoc.R @@ -23,39 +23,50 @@ #' @family Deployment functions #' @export deployDoc <- function(doc, ...) { + doc <- standardizeSingleDocDeployment(doc) + deployApp( + appDir = doc$appDir, + appPrimaryDoc = doc$appPrimaryDoc, + appFiles = doc$appFiles, + ... + ) +} + +standardizeSingleDocDeployment <- function(path, + quiet = FALSE, + error_call = caller_env(), + error_arg = caller_arg(path)) { check_installed( "rmarkdown", version = "0.5.2", reason = "to deploy individual R Markdown documents" ) + check_file(path, error_call = error_call, error_arg = error_arg) - check_file(doc) - - # get qualified doc - qualified_doc <- normalizePath(doc, winslash = "/") + withStatus <- withStatus(quiet) - # see if this doc has runtime: shiny_prerendered, if it does then - # appFiles will be NULL (bundle the entire directory) - if (isShinyRmd(doc)) { - app_files <- NULL + if (isShinyRmd(path)) { + # deploy entire directory + appFiles <- NULL + } else if (isStaticFile(path)) { + # deploy file + dependenciy + withStatus("Discovering document dependencies", { + resources <- rmarkdown::find_external_resources(path) + }) + appFiles <- c(basename(path), resources$path) } else { - # default to deploying just the single file specified - app_files <- basename(qualified_doc) - - # if this document's type supports automated resource discovery, do that now, - # and add the discovered files to the deployment list - ext <- tolower(tools::file_ext(doc)) - if (ext %in% c("rmd", "qmd", "html", "htm")) { - message("Discovering document dependencies... ", appendLF = FALSE) - res <- rmarkdown::find_external_resources(qualified_doc) - message("OK") - app_files <- c(app_files, res$path) - } + # deploy just the file + appFiles <- basename(path) } - # deploy the document with the discovered dependencies - deployApp(appDir = dirname(qualified_doc), - appFiles = app_files, - appPrimaryDoc = basename(qualified_doc), - ...) + list( + appDir = dirname(path), + appPrimaryDoc = basename(path), + appFiles = appFiles + ) +} + +isStaticFile <- function(path) { + ext <- tolower(tools::file_ext(path)) + ext %in% c("rmd", "qmd", "html", "htm") } diff --git a/tests/testthat/_snaps/deployDoc.md b/tests/testthat/_snaps/deployDoc.md new file mode 100644 index 00000000..6f76bb70 --- /dev/null +++ b/tests/testthat/_snaps/deployDoc.md @@ -0,0 +1,8 @@ +# deployDoc correctly reports bad path + + Code + deployDoc("doesntexist.Rmd") + Condition + Error in `deployDoc()`: + ! `doc`, "doesntexist.Rmd", does not exist. + diff --git a/tests/testthat/test-deployDoc.R b/tests/testthat/test-deployDoc.R new file mode 100644 index 00000000..7ae35893 --- /dev/null +++ b/tests/testthat/test-deployDoc.R @@ -0,0 +1,43 @@ +test_that("deployDoc correctly reports bad path", { + expect_snapshot(deployDoc("doesntexist.Rmd"), error = TRUE) +}) + +# standardizeSingleDocDeployment ------------------------------------------ + +test_that("turns appDir into appDir + appPrimarySourceDoc", { + dir <- local_temp_app(list("foo.R" = "")) + + doc <- standardizeSingleDocDeployment(file.path(dir, "foo.R")) + expect_equal(doc$appDir, dir) + expect_equal(doc$appPrimaryDoc, "foo.R") +}) + +test_that("shiny rmd deploys whole directory", { + dir <- local_temp_app(list("foo.Rmd" = c( + "---", + "runtime: shiny", + "---" + ))) + doc <- standardizeSingleDocDeployment(file.path(dir, "foo.Rmd")) + expect_equal(doc$appFiles, NULL) +}) + +test_that("regular rmd deploys file and dependencies", { + dir <- local_temp_app(list( + "foo.Rmd" = c( + "---", + "resource_files: [foo.csv]", + "---" + ), + "foo.csv" = "" + )) + + doc <- standardizeSingleDocDeployment(file.path(dir, "foo.Rmd"), quiet = TRUE) + expect_equal(doc$appFiles, c("foo.Rmd", "foo.csv")) +}) + +test_that("other types deploy that one file", { + dir <- local_temp_app(list("foo.R" = "")) + doc <- standardizeSingleDocDeployment(file.path(dir, "foo.R")) + expect_equal(doc$appFiles, "foo.R") +}) From 0dfd019bb944fcbef0932b51438c97986ec6669d Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 23 Feb 2023 08:30:59 -0600 Subject: [PATCH 2/9] Tweak docs --- R/appDependencies.R | 2 ++ R/deployApp.R | 2 +- R/usage.R | 1 + R/writeManifest.R | 2 ++ man/appDependencies.Rd | 4 ++-- man/deployApp.Rd | 5 +++-- man/showMetrics.Rd | 4 ++-- man/writeManifest.Rd | 4 ++-- 8 files changed, 15 insertions(+), 9 deletions(-) diff --git a/R/appDependencies.R b/R/appDependencies.R index f14cbe58..ce411c5c 100644 --- a/R/appDependencies.R +++ b/R/appDependencies.R @@ -4,6 +4,8 @@ #' parses all .R files in the application directory to determine what packages #' the application depends on; and for each of those packages what other #' packages they depend on. +#' +#' @inheritParams writeManifest #' @inheritParams deployApp #' @return Returns a data frame listing the package #' dependencies detected for the application: \tabular{ll}{ `package` diff --git a/R/deployApp.R b/R/deployApp.R index ffd774ce..8f1afc51 100644 --- a/R/deployApp.R +++ b/R/deployApp.R @@ -20,7 +20,7 @@ #' #' @param appDir Either a directory containing an application (e.g. a Shiny app #' or plumber API) or a path to a document, like an `.html`, `.Rmd`, or -#' `.Qmd`. Defaults to the current working directory. +#' `.Qmd`. Defaults to the working directory. #' @param appFiles A character vector given relative paths to the files and #' directories to bundle and deploy. The default, `NULL`, will include all #' files in `appDir`, apart from any listed in an `.rscignore` file. diff --git a/R/usage.R b/R/usage.R index fc0a5dce..960d84de 100644 --- a/R/usage.R +++ b/R/usage.R @@ -57,6 +57,7 @@ showUsage <- function(appDir = getwd(), appName = NULL, account = NULL, server = #' Show application metrics of a currently deployed application. #' This function only works for ShinyApps servers. #' +#' @inheritParams writeManifest #' @param metricSeries Metric series to query. Refer to the #' [shinyapps.io documentation]() #' for available series. diff --git a/R/writeManifest.R b/R/writeManifest.R index 6345c9cd..75f2940a 100644 --- a/R/writeManifest.R +++ b/R/writeManifest.R @@ -4,6 +4,8 @@ #' that directory describing the deployment requirements for that content. #' #' @inheritParams deployApp +#' @param appDir Path to an application directory. Defaults to the +#' working directory. #' @param verbose If TRUE, prints progress messages to the console #' @export writeManifest <- function(appDir = getwd(), diff --git a/man/appDependencies.Rd b/man/appDependencies.Rd index 54b197b5..a3962c7e 100644 --- a/man/appDependencies.Rd +++ b/man/appDependencies.Rd @@ -7,8 +7,8 @@ appDependencies(appDir = getwd(), appFiles = NULL) } \arguments{ -\item{appDir}{Directory containing application. Defaults to current working -directory.} +\item{appDir}{Path to an application directory. Defaults to the +working directory.} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all diff --git a/man/deployApp.Rd b/man/deployApp.Rd index 3835f705..eba2937f 100644 --- a/man/deployApp.Rd +++ b/man/deployApp.Rd @@ -32,8 +32,9 @@ deployApp( ) } \arguments{ -\item{appDir}{Directory containing application. Defaults to current working -directory.} +\item{appDir}{Either a directory containing an application (e.g. a Shiny app +or plumber API) or a path to a document, like an \code{.html}, \code{.Rmd}, or +\code{.Qmd}. Defaults to the working directory.} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all diff --git a/man/showMetrics.Rd b/man/showMetrics.Rd index a480f924..942ea593 100644 --- a/man/showMetrics.Rd +++ b/man/showMetrics.Rd @@ -25,8 +25,8 @@ for available series.} \href{https://docs.posit.co/shinyapps.io/metrics.html#ApplicationMetrics}{shinyapps.io documentation} for available metrics.} -\item{appDir}{Directory containing application. Defaults to current working -directory.} +\item{appDir}{Path to an application directory. Defaults to the +working directory.} \item{appName}{Name of application (names must be unique within an account). If not supplied on the first deploy, it will be generated from the base diff --git a/man/writeManifest.Rd b/man/writeManifest.Rd index 1b4fa01c..fce6af38 100644 --- a/man/writeManifest.Rd +++ b/man/writeManifest.Rd @@ -17,8 +17,8 @@ writeManifest( ) } \arguments{ -\item{appDir}{Directory containing application. Defaults to current working -directory.} +\item{appDir}{Path to an application directory. Defaults to the +working directory.} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all From 6115e92ce72eeaf0c4714384f4314be7cb4fb990 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 23 Feb 2023 15:26:56 -0600 Subject: [PATCH 3/9] Move normalizePath up --- R/deployApp.R | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/R/deployApp.R b/R/deployApp.R index 8f1afc51..308bf864 100644 --- a/R/deployApp.R +++ b/R/deployApp.R @@ -171,6 +171,7 @@ deployApp <- function(appDir = getwd(), "{.arg appDir} must be a directory or a .Rmd, .Qmd, or .html file" ) } + appDir <- normalizePath(appDir) check_string(appName, allow_null = TRUE) @@ -207,9 +208,6 @@ deployApp <- function(appDir = getwd(), on.exit(options(old_error), add = TRUE) } - # normalize appDir path - appDir <- normalizePath(appDir) - # create the full path that we'll deploy (append document if requested) # TODO(HW): we use appPrimaryDoc here, but we have not inferred it yet # so the appPath will different deneding on whether it's explicitly From 7eee36416f40965a123465db89e2d2f347c652a6 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 23 Feb 2023 15:28:53 -0600 Subject: [PATCH 4/9] Fix (hopefully!) failing test on windows --- tests/testthat/test-deployDoc.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-deployDoc.R b/tests/testthat/test-deployDoc.R index 7ae35893..6d071152 100644 --- a/tests/testthat/test-deployDoc.R +++ b/tests/testthat/test-deployDoc.R @@ -8,7 +8,7 @@ test_that("turns appDir into appDir + appPrimarySourceDoc", { dir <- local_temp_app(list("foo.R" = "")) doc <- standardizeSingleDocDeployment(file.path(dir, "foo.R")) - expect_equal(doc$appDir, dir) + expect_equal(doc$appDir, normalizePath(dir)) expect_equal(doc$appPrimaryDoc, "foo.R") }) From 7c8633b7b882954072af4782fda407adc3534180 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 23 Feb 2023 17:42:14 -0600 Subject: [PATCH 5/9] Normalize path in function too --- R/deployDoc.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/deployDoc.R b/R/deployDoc.R index 5c1c37cc..bbf1e2b9 100644 --- a/R/deployDoc.R +++ b/R/deployDoc.R @@ -42,6 +42,7 @@ standardizeSingleDocDeployment <- function(path, reason = "to deploy individual R Markdown documents" ) check_file(path, error_call = error_call, error_arg = error_arg) + path <- normalizePath(path) withStatus <- withStatus(quiet) From eabc5604770922815db1202770621ec4bf752622 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 23 Feb 2023 17:48:32 -0600 Subject: [PATCH 6/9] Fix merge failure --- R/appDependencies.R | 5 ----- man/appDependencies.Rd | 5 ----- 2 files changed, 10 deletions(-) diff --git a/R/appDependencies.R b/R/appDependencies.R index 06e8a520..03e14d5d 100644 --- a/R/appDependencies.R +++ b/R/appDependencies.R @@ -39,11 +39,6 @@ #' This will tell rsconnect that your app needs the hexbin package, without #' otherwise affecting your code. #' -#' Recursively detect all package dependencies for an application. This function -#' parses all .R files in the application directory to determine what packages -#' the application depends on; and for each of those packages what other -#' packages they depend on. -#' #' @inheritParams writeManifest #' @param appDir Directory containing application. Defaults to current working #' directory. diff --git a/man/appDependencies.Rd b/man/appDependencies.Rd index 69420f3c..c1742212 100644 --- a/man/appDependencies.Rd +++ b/man/appDependencies.Rd @@ -63,11 +63,6 @@ installed. You can overcome this problem with (e.g.) \code{requireNamespace(hexbin)}. This will tell rsconnect that your app needs the hexbin package, without otherwise affecting your code. - -Recursively detect all package dependencies for an application. This function -parses all .R files in the application directory to determine what packages -the application depends on; and for each of those packages what other -packages they depend on. } \examples{ From 72b1beb98096e17c942b4e46c37eac9a61003bc6 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 24 Feb 2023 09:36:53 -0600 Subject: [PATCH 7/9] Deprecate use of individual static files in appDir --- NEWS.md | 3 +++ R/appDependencies.R | 2 +- R/deployApp.R | 36 +++++++++++++++++------------- R/usage.R | 1 - R/writeManifest.R | 2 -- man/deployApp.Rd | 5 ++--- man/showMetrics.Rd | 4 ++-- man/writeManifest.Rd | 4 ++-- tests/testthat/_snaps/deployApp.md | 24 ++++++++++++++++++++ tests/testthat/test-deployApp.R | 13 +++++++++++ 10 files changed, 67 insertions(+), 27 deletions(-) diff --git a/NEWS.md b/NEWS.md index deb37af8..91b96ce7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # rsconnect 0.8.30 (development version) +* `deployApp("foo.Rmd")` has been deprecated. It was never documented, and + it does the same job as `deployDoc()` (#698). + * `deployApp(appPrimaryDoc)` has been deprecated; it did the same job as `recordDir`. diff --git a/R/appDependencies.R b/R/appDependencies.R index 03e14d5d..df958863 100644 --- a/R/appDependencies.R +++ b/R/appDependencies.R @@ -39,7 +39,7 @@ #' This will tell rsconnect that your app needs the hexbin package, without #' otherwise affecting your code. #' -#' @inheritParams writeManifest +#' @inheritParams deployApp #' @param appDir Directory containing application. Defaults to current working #' directory. #' @return A data frame with columns: diff --git a/R/deployApp.R b/R/deployApp.R index ce14a95f..4aa67720 100644 --- a/R/deployApp.R +++ b/R/deployApp.R @@ -18,9 +18,8 @@ #' control to ensure that future you and other collaborators will publish #' to the same location. #' -#' @param appDir Either a directory containing an application (e.g. a Shiny app -#' or plumber API) or a path to a document, like an `.html`, `.Rmd`, or -#' `.Qmd`. Defaults to the working directory. +#' @param appDir A directory containing an application (e.g. a Shiny app +#' or plumber API). #' @param appFiles A character vector given relative paths to the files and #' directories to bundle and deploy. The default, `NULL`, will include all #' files in `appDir`, apart from any listed in an `.rscignore` file. @@ -154,21 +153,26 @@ deployApp <- function(appDir = getwd(), condaMode <- FALSE check_string(appDir) - if (dirExists(appDir)) { - # ok - } else if (file.exists(appDir) && isStaticFile(appDir)) { - doc <- standardizeSingleDocDeployment(appDir) - - appDir <- doc$appDir - appPrimaryDoc <- doc$appPrimaryDoc - if (is.null(appFiles) && is.null(appFileManifest)) { - appFiles <- doc$appFiles - } - } else { - cli::cli_abort( - "{.arg appDir} must be a directory or a .Rmd, .Qmd, or .html file" + if (isStaticFile(appDir) && !dirExists(appDir)) { + lifecycle::deprecate_warn( + when = "0.9.0", + what = "deployApp(appDir = 'takes a directory, not a document,')", + with = "deployDoc()" ) + return(deployDoc( + appDir, + appName = appName, + appTitle = appTitle, + account = account, + server = server, + upload = upload, + recordDir = recordDir, + launch.browser = launch.browser, + logLevel = logLevel, + lint = lint + )) } + check_directory(appDir) appDir <- normalizePath(appDir) check_string(appName, allow_null = TRUE) diff --git a/R/usage.R b/R/usage.R index 960d84de..fc0a5dce 100644 --- a/R/usage.R +++ b/R/usage.R @@ -57,7 +57,6 @@ showUsage <- function(appDir = getwd(), appName = NULL, account = NULL, server = #' Show application metrics of a currently deployed application. #' This function only works for ShinyApps servers. #' -#' @inheritParams writeManifest #' @param metricSeries Metric series to query. Refer to the #' [shinyapps.io documentation]() #' for available series. diff --git a/R/writeManifest.R b/R/writeManifest.R index 75f2940a..6345c9cd 100644 --- a/R/writeManifest.R +++ b/R/writeManifest.R @@ -4,8 +4,6 @@ #' that directory describing the deployment requirements for that content. #' #' @inheritParams deployApp -#' @param appDir Path to an application directory. Defaults to the -#' working directory. #' @param verbose If TRUE, prints progress messages to the console #' @export writeManifest <- function(appDir = getwd(), diff --git a/man/deployApp.Rd b/man/deployApp.Rd index a1af373e..a675969b 100644 --- a/man/deployApp.Rd +++ b/man/deployApp.Rd @@ -32,9 +32,8 @@ deployApp( ) } \arguments{ -\item{appDir}{Either a directory containing an application (e.g. a Shiny app -or plumber API) or a path to a document, like an \code{.html}, \code{.Rmd}, or -\code{.Qmd}. Defaults to the working directory.} +\item{appDir}{A directory containing an application (e.g. a Shiny app +or plumber API).} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all diff --git a/man/showMetrics.Rd b/man/showMetrics.Rd index 942ea593..614af194 100644 --- a/man/showMetrics.Rd +++ b/man/showMetrics.Rd @@ -25,8 +25,8 @@ for available series.} \href{https://docs.posit.co/shinyapps.io/metrics.html#ApplicationMetrics}{shinyapps.io documentation} for available metrics.} -\item{appDir}{Path to an application directory. Defaults to the -working directory.} +\item{appDir}{A directory containing an application (e.g. a Shiny app +or plumber API).} \item{appName}{Name of application (names must be unique within an account). If not supplied on the first deploy, it will be generated from the base diff --git a/man/writeManifest.Rd b/man/writeManifest.Rd index fce6af38..fdf95744 100644 --- a/man/writeManifest.Rd +++ b/man/writeManifest.Rd @@ -17,8 +17,8 @@ writeManifest( ) } \arguments{ -\item{appDir}{Path to an application directory. Defaults to the -working directory.} +\item{appDir}{A directory containing an application (e.g. a Shiny app +or plumber API).} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all diff --git a/tests/testthat/_snaps/deployApp.md b/tests/testthat/_snaps/deployApp.md index 4715b789..d0b1a263 100644 --- a/tests/testthat/_snaps/deployApp.md +++ b/tests/testthat/_snaps/deployApp.md @@ -1,3 +1,27 @@ +# appDir must be an existing directory + + Code + deployApp(1) + Condition + Error in `deployApp()`: + ! `appDir` must be a single string, not the number 1. + Code + deployApp("doesntexist") + Condition + Error in `deployApp()`: + ! `appDir`, "doesntexist", does not exist. + +# single document appDir is deprecated + + Code + deployApp("foo.Rmd") + Condition + Warning: + The `appDir` argument of `deployApp()` takes a directory, not a document, as of rsconnect 0.9.0. + i Please use `deployDoc()` instead. + Error in `deployDoc()`: + ! `doc`, "foo.Rmd", does not exist. + # appPrimaryDoc must exist, if supplied Code diff --git a/tests/testthat/test-deployApp.R b/tests/testthat/test-deployApp.R index d4ee668c..b3d234bf 100644 --- a/tests/testthat/test-deployApp.R +++ b/tests/testthat/test-deployApp.R @@ -1,3 +1,16 @@ +test_that("appDir must be an existing directory", { + expect_snapshot(error = TRUE, { + deployApp(1) + deployApp("doesntexist") + }) +}) + +test_that("single document appDir is deprecated", { + expect_snapshot(error = TRUE, { + deployApp("foo.Rmd") + }) +}) + test_that("appPrimaryDoc must exist, if supplied", { dir <- local_temp_app() From b2641a36a1d3b4f7b72b2b61a6c0069bb0c0f4db Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 24 Feb 2023 09:38:32 -0600 Subject: [PATCH 8/9] Restore missing sentence --- R/deployApp.R | 2 +- man/deployApp.Rd | 2 +- man/showMetrics.Rd | 2 +- man/writeManifest.Rd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/deployApp.R b/R/deployApp.R index 4aa67720..5d5af030 100644 --- a/R/deployApp.R +++ b/R/deployApp.R @@ -19,7 +19,7 @@ #' to the same location. #' #' @param appDir A directory containing an application (e.g. a Shiny app -#' or plumber API). +#' or plumber API). Defaults to the current directory. #' @param appFiles A character vector given relative paths to the files and #' directories to bundle and deploy. The default, `NULL`, will include all #' files in `appDir`, apart from any listed in an `.rscignore` file. diff --git a/man/deployApp.Rd b/man/deployApp.Rd index a675969b..9218e5a0 100644 --- a/man/deployApp.Rd +++ b/man/deployApp.Rd @@ -33,7 +33,7 @@ deployApp( } \arguments{ \item{appDir}{A directory containing an application (e.g. a Shiny app -or plumber API).} +or plumber API). Defaults to the current directory.} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all diff --git a/man/showMetrics.Rd b/man/showMetrics.Rd index 614af194..ad6a912f 100644 --- a/man/showMetrics.Rd +++ b/man/showMetrics.Rd @@ -26,7 +26,7 @@ for available series.} for available metrics.} \item{appDir}{A directory containing an application (e.g. a Shiny app -or plumber API).} +or plumber API). Defaults to the current directory.} \item{appName}{Name of application (names must be unique within an account). If not supplied on the first deploy, it will be generated from the base diff --git a/man/writeManifest.Rd b/man/writeManifest.Rd index fdf95744..95fc8e0f 100644 --- a/man/writeManifest.Rd +++ b/man/writeManifest.Rd @@ -18,7 +18,7 @@ writeManifest( } \arguments{ \item{appDir}{A directory containing an application (e.g. a Shiny app -or plumber API).} +or plumber API). Defaults to the current directory.} \item{appFiles}{A character vector given relative paths to the files and directories to bundle and deploy. The default, \code{NULL}, will include all From de9fd39eefa57084622485bc264ee06a367e8ea5 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 24 Feb 2023 09:57:40 -0600 Subject: [PATCH 9/9] Maybe dirname de-normalises? --- R/deployDoc.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/deployDoc.R b/R/deployDoc.R index bbf1e2b9..feea39f4 100644 --- a/R/deployDoc.R +++ b/R/deployDoc.R @@ -61,7 +61,7 @@ standardizeSingleDocDeployment <- function(path, } list( - appDir = dirname(path), + appDir = normalizePath(dirname(path)), appPrimaryDoc = basename(path), appFiles = appFiles )