Fix target removal checks
This commit is contained in:
parent
864f36840a
commit
f3aa1f0eb2
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue