Skip to content

Commit

Permalink
Don't look up application by name on cloud
Browse files Browse the repository at this point in the history
Fixes #808
  • Loading branch information
hadley committed May 2, 2023
1 parent 125e8f0 commit 9412daa
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions R/deploymentTarget.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ deploymentTarget <- function(recordPath = ".",
}

appId <- NULL
# Have we previously deployed elsewhere?
existing <- applications(fullAccount$name, fullAccount$server)
if (appName %in% existing$name) {
thisApp <- existing[appName == existing$name, , drop = FALSE]
uniqueName <- findUnique(appName, existing$name)

if (shouldUpdateApp(thisApp, uniqueName, forceUpdate)) {
appId <- thisApp$id
appName <- thisApp$name
} else {
appName <- uniqueName
if (!isCloudServer(fullAccount$server)) {
# Have we previously deployed elsewhere? We can't do this on cloud
# because it assigns random app names (see #808 for details).
existing <- applications(fullAccount$name, fullAccount$server)
if (appName %in% existing$name) {
thisApp <- existing[appName == existing$name, , drop = FALSE]
uniqueName <- findUnique(appName, existing$name)

if (shouldUpdateApp(thisApp, uniqueName, forceUpdate)) {
appId <- thisApp$id
appName <- thisApp$name
} else {
appName <- uniqueName
}
}
}

Expand Down

0 comments on commit 9412daa

Please sign in to comment.