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

This commit is contained in:
Jose Diaz-Gonzalez committed 2018-02-17 23:15:15 -05:00
1 parent 8eb4246040
commit 77c63b8d98
1 file changed
+8 -2
+8 -2
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 "$@"