refactor: use normal if statement instead of && calls
This commit is contained in:
@@ -7,8 +7,12 @@ trigger-domains-post-app-rename-setup() {
|
||||
declare trigger="post-app-rename-setup"
|
||||
declare OLD_APP="$1" NEW_APP="$2"
|
||||
|
||||
[[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
|
||||
[[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
|
||||
if [[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]]; then
|
||||
sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]]; then
|
||||
sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
|
||||
fi
|
||||
}
|
||||
|
||||
trigger-domains-post-app-rename-setup "$@"
|
||||
|
||||
@@ -7,7 +7,9 @@ trigger-git-post-app-clone-setup() {
|
||||
declare trigger="post-app-clone-setup"
|
||||
declare OLD_APP="$1" NEW_APP="$2"
|
||||
|
||||
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
|
||||
if [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]]; then
|
||||
sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
|
||||
fi
|
||||
}
|
||||
|
||||
trigger-git-post-app-clone-setup "$@"
|
||||
|
||||
@@ -7,7 +7,9 @@ trigger-git-post-app-rename-setup() {
|
||||
declare trigger="post-app-rename-setup"
|
||||
declare OLD_APP="$1" NEW_APP="$2"
|
||||
|
||||
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
|
||||
if [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]]; then
|
||||
sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
|
||||
fi
|
||||
}
|
||||
|
||||
trigger-git-post-app-rename-setup "$@"
|
||||
|
||||
Reference in New Issue
Block a user