From c207d49b99b5e073b17ed635f9aab134f3773c4f Mon Sep 17 00:00:00 2001 From: ttionya Date: Thu, 28 Jul 2022 10:56:19 +0800 Subject: [PATCH] feat: add force restore short option --- scripts/restore.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/restore.sh b/scripts/restore.sh index 739c75f..d5de617 100644 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -10,7 +10,7 @@ RESTORE_FILE_SENDS="" RESTORE_FILE_ZIP="" RESTORE_FILE_DIR="${RESTORE_DIR}" ZIP_PASSWORD="" -FORCE_RESTORE=false +FORCE_RESTORE="FALSE" function clear_extract_dir() { rm -rf "${RESTORE_EXTRACT_DIR}" @@ -263,9 +263,9 @@ function restore() { RESTORE_FILE_SENDS="$(basename "$1")" shift ;; - --force-restore) + -f|--force-restore) shift - FORCE_RESTORE=true + FORCE_RESTORE="TRUE" shift ;; *) @@ -279,7 +279,7 @@ function restore() { check_empty_input check_data_dir_exist - if $FORCE_RESTORE; then + if [[ "${FORCE_RESTORE}" == "TRUE" ]]; then restore_file else color yellow "Restore will overwrite the existing files, continue? (y/N)"