From 8df93143524d3dbfe0ae11d77978f83ca807cbdf Mon Sep 17 00:00:00 2001 From: Aron Atkins Date: Thu, 31 Aug 2023 11:22:40 -0400 Subject: [PATCH] fix account discovery by showProperties (#984) fixes #980 --- NEWS.md | 2 ++ R/configureApp.R | 20 ++++++++------------ man/setProperty.Rd | 4 ++-- man/showProperties.Rd | 14 +++++++++++--- man/unsetProperty.Rd | 2 +- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/NEWS.md b/NEWS.md index 88431279..d1ab883a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,8 @@ `Applications.ManifestEnvironmentManagementSelection = false`. Requires Posit Connect `>=2023.07.0`. (#977) +* Fix account discovery by `showProperties()`. (#980) + # rsconnect 1.0.2 * Fixed redeployments to shinyapps.io where `appName` is provided, but no local diff --git a/R/configureApp.R b/R/configureApp.R index e92c3e18..95d903d4 100644 --- a/R/configureApp.R +++ b/R/configureApp.R @@ -74,8 +74,8 @@ configureApp <- function(appName, appDir = getwd(), account = NULL, server = NUL #' #' Set a property on currently deployed ShinyApps application. #' -#' @param propertyName Name of property to set -#' @param propertyValue Nalue to set property to +#' @param propertyName Name of property +#' @param propertyValue Property value #' @param appName Name of application #' @param appPath Directory or file that was deployed. Defaults to current #' working directory. @@ -124,11 +124,7 @@ setProperty <- function(propertyName, propertyValue, appPath = getwd(), #' Unset a property on currently deployed ShinyApps application (restoring to #' its default value) #' -#' @param propertyName Name of property to unset -#' @param appName Name of application -#' @param appPath Directory or file that was deployed. Defaults to current -#' working directory. -#' @inheritParams deployApp +#' @inheritParams setProperty #' @param force Forcibly unset the property #' #' @note This function only works for ShinyApps servers. @@ -172,20 +168,20 @@ unsetProperty <- function(propertyName, appPath = getwd(), appName = NULL, #' @param appName Name of application #' @param appPath Directory or file that was deployed. Defaults to current #' working directory. -#' @param account Account name. If a single account is registered on the -#' system then this parameter can be omitted. +#' @inheritParams deployApp #' #' @note This function works only for ShinyApps servers. #' #' @export -showProperties <- function(appPath = getwd(), appName = NULL, account = NULL) { +showProperties <- function(appPath = getwd(), appName = NULL, account = NULL, server = NULL) { deployment <- findDeployment( appPath = appPath, appName = appName, - account = account + account = account, + server = server ) - accountDetails <- accountInfo(deployment$account) + accountDetails <- accountInfo(deployment$account, deployment$server) client <- clientForAccount(accountDetails) application <- getAppByName(client, accountDetails, deployment$name) if (is.null(application)) diff --git a/man/setProperty.Rd b/man/setProperty.Rd index ed3f56d8..531f2f71 100644 --- a/man/setProperty.Rd +++ b/man/setProperty.Rd @@ -15,9 +15,9 @@ setProperty( ) } \arguments{ -\item{propertyName}{Name of property to set} +\item{propertyName}{Name of property} -\item{propertyValue}{Nalue to set property to} +\item{propertyValue}{Property value} \item{appPath}{Directory or file that was deployed. Defaults to current working directory.} diff --git a/man/showProperties.Rd b/man/showProperties.Rd index 67ecf549..9511e0fd 100644 --- a/man/showProperties.Rd +++ b/man/showProperties.Rd @@ -4,7 +4,12 @@ \alias{showProperties} \title{Show Application property} \usage{ -showProperties(appPath = getwd(), appName = NULL, account = NULL) +showProperties( + appPath = getwd(), + appName = NULL, + account = NULL, + server = NULL +) } \arguments{ \item{appPath}{Directory or file that was deployed. Defaults to current @@ -12,8 +17,11 @@ working directory.} \item{appName}{Name of application} -\item{account}{Account name. If a single account is registered on the -system then this parameter can be omitted.} +\item{account, server}{Uniquely identify a remote server with either your +user \code{account}, the \code{server} name, or both. If neither are supplied, and +there are multiple options, you'll be prompted to pick one. + +Use \code{\link[=accounts]{accounts()}} to see the full list of available options.} } \description{ Show propreties of an application deployed to ShinyApps. diff --git a/man/unsetProperty.Rd b/man/unsetProperty.Rd index f8569706..009e538b 100644 --- a/man/unsetProperty.Rd +++ b/man/unsetProperty.Rd @@ -14,7 +14,7 @@ unsetProperty( ) } \arguments{ -\item{propertyName}{Name of property to unset} +\item{propertyName}{Name of property} \item{appPath}{Directory or file that was deployed. Defaults to current working directory.}