From 5eb63f5dfccb9ce650d7cda59705523009a64a09 Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Tue, 16 May 2017 09:52:57 -0500 Subject: [PATCH] Be more careful about restoring backups (fix #509) --- README.md | 2 +- bin/install | 11 +++++++---- bin/install.sha256 | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a89de0f..87c205c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ fish install --path=~/.local/share/omf --config=~/.config/omf You can verify the integrity of the downloaded installer by verifying the script against [this checksum](bin/install.sha256): ``` -f2e24da717a9399ebb6a2e78f16627b99b6a0c31aba9123542472de94d9d6da6 install +92ca680df48640e744b361d376194c5f5f8d6b4f1ac775d22417a0d8a8108767 install ``` You can also install Oh My Fish with Git or with an offline source tarball downloaded from the [releases page][releases]: diff --git a/bin/install b/bin/install index 69d9867..de89308 100755 --- a/bin/install +++ b/bin/install @@ -373,7 +373,6 @@ function uninstall_omf end # Restore backed-up files - restore_backup_file "$FISH_CONFIG/config.fish" restore_backup_file "$FISH_CONFIG/functions/fish_prompt.fish" say "Uninstall complete" @@ -411,9 +410,13 @@ function restore_backup_file -a file_path set -l backup_file_path (echo $backup_file_list | command tr ' ' '\n' | command sort -r | command head -1) if test -e "$backup_file_path" - say "Restoring backup file to $path/$file" - command mv "$backup_file_path" "$path/$file" ^/dev/null - or abort "Could not restore backup $backup_file_path" + say "Found a backup of $file at $backup_file_path" + + if confirm "Would you like to restore it (overwrite existing)?" + say "Restoring backup file to $path/$file" + command mv "$backup_file_path" "$path/$file" ^/dev/null + or abort "Could not restore backup $backup_file_path" + end end end diff --git a/bin/install.sha256 b/bin/install.sha256 index 1270d09..ca64d26 100644 --- a/bin/install.sha256 +++ b/bin/install.sha256 @@ -1 +1 @@ -f2e24da717a9399ebb6a2e78f16627b99b6a0c31aba9123542472de94d9d6da6 install +92ca680df48640e744b361d376194c5f5f8d6b4f1ac775d22417a0d8a8108767 install