Fix target removal checks

This commit is contained in:
Florine W. Dekker 2021-04-21 23:49:21 +02:00
parent 864f36840a
commit f3aa1f0eb2
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 6 additions and 6 deletions

View File

@ -2,10 +2,10 @@
# Usage: deploy-npm [--delete-target] target
if [ "$1" == "--delete-target" ]; then
delete_target=1
delete_target=true
dst_dir="$2"
else
delete-target=0
delete_target=false
dst_dir="$1"
fi
@ -36,7 +36,7 @@ cd "$tmp_dir" || exit
npm ci
npm run deploy
if [ $delete_target -eq 1 ]; then
if [ "$delete_target" = true ]; then
echo "[[ Deploy ]] Deleting then recreating '$dst_dir'."
rm -rf "${dst_dir:?}/**"
chmod g+w "$dst_dir"

View File

@ -2,10 +2,10 @@
# Usage: deploy-static [--delete-target] target
if [ "$1" == "--delete-target" ]; then
delete_target=1
delete_target=true
dst_dir="$2"
else
delete-target=0
delete_target=false
dst_dir="$1"
fi
@ -32,7 +32,7 @@ echo "[[ Deploy ]] Cloning repository at '$repo_dir' into '$tmp_dir'."
git clone "$repo_dir" "$tmp_dir"
rm -rf "$tmp_dir/.git/"
if [ $delete_target -eq 1 ]; then
if [ "$delete_target" = true ]; then
echo "[[ Deploy ]] Deleting then recreating '$dst_dir'."
rm -rf "${dst_dir:?}/**"
chmod g+w "$dst_dir"