feat: ensure we don't try to restore an app that wasn't deployed

This commit is contained in:
Jose Diaz-Gonzalez
2018-01-12 01:12:14 -05:00
parent 7330a849a5
commit f0ee6288fb

View File

@@ -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