mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 22:03:53 +08:00
Be more careful about restoring backups (fix #509)
This commit is contained in:
parent
bc8f3142f1
commit
5eb63f5dfc
|
@ -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):
|
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]:
|
You can also install Oh My Fish with Git or with an offline source tarball downloaded from the [releases page][releases]:
|
||||||
|
|
11
bin/install
11
bin/install
|
@ -373,7 +373,6 @@ function uninstall_omf
|
||||||
end
|
end
|
||||||
|
|
||||||
# Restore backed-up files
|
# Restore backed-up files
|
||||||
restore_backup_file "$FISH_CONFIG/config.fish"
|
|
||||||
restore_backup_file "$FISH_CONFIG/functions/fish_prompt.fish"
|
restore_backup_file "$FISH_CONFIG/functions/fish_prompt.fish"
|
||||||
|
|
||||||
say "Uninstall complete"
|
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)
|
set -l backup_file_path (echo $backup_file_list | command tr ' ' '\n' | command sort -r | command head -1)
|
||||||
|
|
||||||
if test -e "$backup_file_path"
|
if test -e "$backup_file_path"
|
||||||
say "Restoring backup file to $path/$file"
|
say "Found a backup of $file at $backup_file_path"
|
||||||
command mv "$backup_file_path" "$path/$file" ^/dev/null
|
|
||||||
or abort "Could not restore backup $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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
f2e24da717a9399ebb6a2e78f16627b99b6a0c31aba9123542472de94d9d6da6 install
|
92ca680df48640e744b361d376194c5f5f8d6b4f1ac775d22417a0d8a8108767 install
|
||||||
|
|
Loading…
Reference in New Issue
Block a user