2020-05-19 06:03:25 +03:00
|
|
|
function tide_uninstall
|
|
|
|
if not _user_confirm_defaultNo 'Uninstall tide theme?'
|
2020-05-20 00:10:19 +03:00
|
|
|
printf '%s\n' 'Aborted uninstall.'
|
2020-05-04 08:36:33 +03:00
|
|
|
return 1
|
|
|
|
end
|
2020-05-20 00:10:19 +03:00
|
|
|
printf '%s\n' 'Uninstalling tide theme...'
|
2020-04-29 07:19:32 +03:00
|
|
|
|
2020-05-04 08:36:33 +03:00
|
|
|
set -l fishPrompt (functions -D fish_prompt)
|
2020-04-29 07:19:32 +03:00
|
|
|
|
2020-05-04 08:36:33 +03:00
|
|
|
# ----------------------------------Remove Files----------------------------------
|
2020-05-20 20:39:44 +03:00
|
|
|
if test -e $_tide_dir
|
|
|
|
rm -r $_tide_dir
|
2020-05-04 08:36:33 +03:00
|
|
|
end
|
2020-04-13 01:40:49 +03:00
|
|
|
|
2020-05-04 08:36:33 +03:00
|
|
|
set -l fishPromptFirstLine (head -n 1 $fishPrompt)
|
2020-05-19 06:03:25 +03:00
|
|
|
if test "$fishPromptFirstLine" = '# Created by tide configure'
|
2020-05-04 08:36:33 +03:00
|
|
|
rm $fishPrompt
|
|
|
|
source "$__fish_data_dir/functions/fish_prompt.fish"
|
|
|
|
end
|
2020-04-26 00:52:39 +03:00
|
|
|
|
2020-05-19 06:03:25 +03:00
|
|
|
set -a tideFunctions 'tide'
|
|
|
|
set -a tideFunctions 'tide_'{'decolor', 'left_prompt', 'right_prompt'}
|
|
|
|
set -a tideFunctions '_tide_'{'cmd_duration', 'context', 'git_prompt', 'jobs', 'newline', 'prompt_char', 'pwd', 'status', 'time'}
|
|
|
|
for func in $tideFunctions
|
2020-05-04 08:36:33 +03:00
|
|
|
rm "$__fish_config_dir/functions/$func.fish"
|
|
|
|
end
|
2020-04-26 00:52:39 +03:00
|
|
|
|
2020-05-19 06:03:25 +03:00
|
|
|
set -a tideConfd 'tide_'{'count_left_prompt_height', 'cursor_movement'}
|
|
|
|
for file in $tideConfd
|
2020-05-19 05:47:12 +03:00
|
|
|
rm "$__fish_config_dir/conf.d/$file.fish"
|
|
|
|
end
|
|
|
|
|
2020-05-04 08:36:33 +03:00
|
|
|
# -----------------------------Erase Theme Variables------------------------------
|
2020-05-20 20:39:44 +03:00
|
|
|
for var in $_tide_var_list
|
2020-05-04 08:36:33 +03:00
|
|
|
set -e $var
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|
2020-05-20 20:39:44 +03:00
|
|
|
set -e _tide_var_list
|
2020-05-04 08:36:33 +03:00
|
|
|
|
2020-05-20 00:10:19 +03:00
|
|
|
printf '%s\n' 'Tide theme uninstalled.'
|
2020-04-22 06:06:05 +03:00
|
|
|
end
|
|
|
|
|
2020-04-26 00:52:39 +03:00
|
|
|
function _user_confirm_defaultNo -a question
|
2020-04-22 06:06:05 +03:00
|
|
|
while true
|
|
|
|
read -P "$question [y/N] " input
|
|
|
|
|
|
|
|
switch $input
|
|
|
|
case y Y yes Yes
|
|
|
|
return 0
|
|
|
|
case n N no No
|
|
|
|
return 1
|
|
|
|
case ''
|
|
|
|
return 1
|
|
|
|
end
|
|
|
|
end
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|