这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions plugins/ps/functions
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ ps_restart() {
local APP="$1"; verify_app_name "$APP"
local IMAGE_TAG=$(get_running_image_tag "$APP")

! (is_deployed "$APP") && echo "App $APP has not been deployed" && exit 0

release_and_deploy "$APP" "$IMAGE_TAG"
if is_deployed "$APP"; then
release_and_deploy "$APP" "$IMAGE_TAG"
else
echo "App $APP has not been deployed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we return 1 here at least?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. After all IMHO that even isn't an error, there's just nothing to be done and then echo just shows a log message. All current callers (ps/subcommands/restartall, nginx-vhosts/proxy-disable and nginx-vhosts/proxy-enable) don't need the information. So YAGNI.

Even worse, if we return 1 here we would have to change all callers (since they set -e they then would exit 1)

fi
}

ps_scale() {
Expand Down