fix: do not rebuild an app that has never been deployed

This commit is contained in:
Jose Diaz-Gonzalez
2018-01-14 14:37:44 -05:00
parent 8eb4246040
commit 77c63b8d98

View File

@@ -6,8 +6,14 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
ps_rebuild_cmd() {
declare desc="rebuilds an app from source"
local cmd="ps:rebuild"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
ps_rebuild "$2"
local APP="$2"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
if (is_deployed "$APP"); then
ps_rebuild "$APP"
else
dokku_log_warn "App $APP has not been deployed"
fi
}
ps_rebuild_cmd "$@"