From f3aa1f0eb2346c56d58226904666a8fa6cf10cd6 Mon Sep 17 00:00:00 2001 From: "Felix W. Dekker" Date: Wed, 21 Apr 2021 23:49:21 +0200 Subject: [PATCH] Fix target removal checks --- deploy-npm | 6 +++--- deploy-static | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy-npm b/deploy-npm index fa056c9..e248cbf 100755 --- a/deploy-npm +++ b/deploy-npm @@ -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" diff --git a/deploy-static b/deploy-static index d642218..9435a20 100755 --- a/deploy-static +++ b/deploy-static @@ -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"