feat: add verify_app_name calls to all shell subcommands
Without this, folks could potentially run commands against invalid applications.
This commit is contained in:
@@ -81,9 +81,8 @@ cmd-storage-list() {
|
||||
declare cmd="storage:list"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
local passed_phases="deploy"
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
|
||||
verify_app_name "$APP"
|
||||
dokku_log_quiet "$APP volume bind-mounts:"
|
||||
get_bind_mounts "$(get_phase_file_path "$passed_phases")"
|
||||
|
||||
@@ -12,9 +12,6 @@ cmd-storage-mount() {
|
||||
declare APP="$1" MOUNT_PATH="$2"
|
||||
local passed_phases=(deploy run)
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$MOUNT_PATH" ]] && dokku_log_fail "Please specify two paths delimited by colon."
|
||||
|
||||
verify_app_name "$APP"
|
||||
verify_paths "$MOUNT_PATH"
|
||||
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" && dokku_log_fail "Mount path already exists."
|
||||
|
||||
@@ -12,8 +12,6 @@ cmd-storage-unmount() {
|
||||
declare APP="$1" MOUNT_PATH="$2"
|
||||
local passed_phases=(deploy run)
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$MOUNT_PATH" ]] && dokku_log_fail "Please specify two paths delimited by colon."
|
||||
verify_app_name "$APP"
|
||||
verify_paths "$MOUNT_PATH"
|
||||
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" || dokku_log_fail "Mount path does not exist."
|
||||
|
||||
Reference in New Issue
Block a user