From f0ee6288fbe88c78ebc8648ce787a3429853e2a6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Jan 2018 01:12:14 -0500 Subject: [PATCH] feat: ensure we don't try to restore an app that wasn't deployed --- plugins/ps/subcommands/restore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/ps/subcommands/restore b/plugins/ps/subcommands/restore index 25face8bf..0264d7ec4 100755 --- a/plugins/ps/subcommands/restore +++ b/plugins/ps/subcommands/restore @@ -10,6 +10,11 @@ ps_restore_cmd() { local APP="$2" if [[ -n "$APP" ]]; then + if ! (is_deployed "$APP"); then + dokku_log_warn "App $APP has not been deployed" + return + fi + DOKKU_APP_RESTORE="$(config_get "$APP" DOKKU_APP_RESTORE || true)" if [[ $DOKKU_APP_RESTORE != 0 ]]; then ps_start "$APP" || dokku_log_warn "dokku ps:restore ${APP} failed" @@ -37,7 +42,7 @@ ps_restore_all() { for app in $(dokku_apps); do local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true) if [[ $DOKKU_APP_RESTORE != 0 ]]; then - echo "Restoring app $app ..." + dokku_log_verbose "Restoring app $app ..." if ps_start "$app"; then continue fi