refactor: use normal if statement instead of && calls

This commit is contained in:
Jose Diaz-Gonzalez committed 2020-02-17 18:27:11 -05:00
1 parent 799a5713c2
commit 0b40414170
3 files changed
+12 -4

No files matched your search

+6 -2
View File
@@ -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 "$@"