2015-10-04 18:02:38 -03:00
|
|
|
function __omf.destroy.restore_backup -a file_path
|
|
|
|
set -l path (dirname $file_path)
|
|
|
|
set -l file (basename $file_path)
|
|
|
|
set -l name (echo $file | cut -d. -f1)
|
|
|
|
set -l backup_file_path (echo $path/$name.*.copy | tr ' ' '\n' | sort -r | head -1)
|
|
|
|
|
|
|
|
if test -e "$backup_file_path"
|
|
|
|
mv "$backup_file_path" "$path/$file" ^/dev/null
|
|
|
|
else
|
|
|
|
rm -f "$path/$file" ^/dev/null
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-27 19:55:29 +01:00
|
|
|
function omf.destroy -d "Remove Oh My Fish"
|
2015-08-27 00:20:13 +09:00
|
|
|
echo (omf::dim)"Removing Oh My Fish..."(omf::off)
|
|
|
|
|
2015-11-04 09:28:06 -02:00
|
|
|
for pkg in (basename -a $OMF_PATH/pkg/*)
|
2015-10-03 01:03:23 +01:00
|
|
|
emit uninstall_$pkg
|
2015-09-12 23:50:22 +02:00
|
|
|
end
|
2015-08-27 00:20:13 +09:00
|
|
|
|
2015-10-04 18:02:38 -03:00
|
|
|
set -q XDG_CONFIG_HOME;
|
|
|
|
or set -l XDG_CONFIG_HOME "$HOME/.config"
|
2015-09-17 22:41:56 +02:00
|
|
|
|
2015-10-04 18:02:38 -03:00
|
|
|
set -l fish_config_home $XDG_CONFIG_HOME/fish
|
|
|
|
set -l fish_prompt_home $fish_config_home/functions
|
|
|
|
|
|
|
|
__omf.destroy.restore_backup "$fish_config_home/config.fish"
|
|
|
|
__omf.destroy.restore_backup "$fish_prompt_home/fish_prompt.fish"
|
2015-08-27 00:20:13 +09:00
|
|
|
|
|
|
|
if test "$OMF_PATH" != "$HOME"
|
|
|
|
rm -rf "$OMF_PATH"
|
|
|
|
end
|
|
|
|
|
2015-09-29 03:09:02 +01:00
|
|
|
set -q CI; or exec fish < /dev/tty
|
2015-08-27 00:20:13 +09:00
|
|
|
end
|