Skip to content

Commit

Permalink
feat: add force restore short option
Browse files Browse the repository at this point in the history
  • Loading branch information
ttionya committed Jul 28, 2022
1 parent a4416f4 commit c207d49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
;;
*)
Expand All @@ -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)"
Expand Down

0 comments on commit c207d49

Please sign in to comment.