Skip to content

Commit

Permalink
chore: Check client directly to know if it supports setEnvVars
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Sep 8, 2023
1 parent 523f1e5 commit f3dac5b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/deployApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,14 @@ deployApp <- function(appDir = getwd(),
stop("Posit Connect does not support deploying without uploading. ",
"Specify upload=TRUE to upload and re-deploy your application.")
}
if (!isConnectServer(target$server) && length(envVars) > 0) {
cli::cli_abort("{.arg envVars} only supported for Posit Connect servers")
}

accountDetails <- accountInfo(target$account, target$server)
client <- clientForAccount(accountDetails)

if (length(envVars) > 0 && !"setEnvVars" %in% names(client)) {
cli::cli_abort("{target$server} does not support setting {.arg envVars}")
}

if (verbose) {
showCookies(serverInfo(accountDetails$server)$url)
}
Expand Down

0 comments on commit f3dac5b

Please sign in to comment.