Merge pull request #9080 from dokku/apps-create-existing-dir

Check app directory when creating a new app
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2026-09-25 17:54:16 -04:00
commit 9294aafcbf
3 files changed
+68 -3

No files matched your search

+6 -1
View File
@@ -14,6 +14,11 @@ func appExists(appName string) error {
return common.VerifyAppName(appName)
}
// checks if an app directory already exists, regardless of app visibility
func appNameTaken(appName string) bool {
return common.DirectoryExists(common.AppRoot(appName))
}
// checks if an app is locked
func appIsLocked(appName string) bool {
lockPath := getLockPath(appName)
@@ -27,7 +32,7 @@ func createApp(appName string) error {
return err
}
if err := appExists(appName); err == nil {
if appNameTaken(appName) {
return errors.New("Name is already taken")
}
+2 -2
View File
@@ -27,7 +27,7 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
return err
}
if err := appExists(newAppName); err == nil {
if appNameTaken(newAppName) {
if ignoreExisting {
common.LogWarn("Name is already taken")
return nil
@@ -178,7 +178,7 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
return err
}
if err := appExists(newAppName); err == nil {
if appNameTaken(newAppName) {
return errors.New("Name is already taken")
}