Merge pull request #4243 from dokku/4129-avoid-deletion

Do not delete app when the app name is invalid
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2020-12-15 03:28:52 -05:00
commit f279ce44b2
2 files changed
-6

No files matched your search

-5
View File
@@ -406,11 +406,6 @@ func IsValidAppName(appName string) error {
return nil return nil
} }
appRoot := AppRoot(appName)
if DirectoryExists(appRoot) {
os.RemoveAll(appRoot)
}
return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores") return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores")
} }
-1
View File
@@ -190,7 +190,6 @@ is_valid_app_name() {
fi fi
fi fi
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "${DOKKU_ROOT:?}/$APP"
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores" dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores"
} }