Add migration script from v4 to v5

This commit is contained in:
Ilan Cosman 2021-08-10 08:33:45 -07:00
parent bd875fb85b
commit 79e8e40c84

View File

@ -16,6 +16,29 @@ function _tide_init_install --on-event _tide_init_install
end
end
function _tide_init_update --on-event _tide_init_update
# v5 introduced tide_prompt_min_cols. Only proceed if older than v5
set --query tide_prompt_min_cols && return
# Save old vars to tmp file
set -l tmp (mktemp -t tide_old_config.XXXXX)
tide bug-report --verbose >$tmp
# Delete old vars
set -e $_tide_var_list _tide_var_list $_tide_left_prompt_display_var $_tide_right_prompt_display_var
# Print a warning
set_color yellow
echo "You have upgraded to version 5 of Tide."
echo "Since there are breaking changes, your old configuraton has been saved in:"
set_color normal
echo $tmp
sleep 5
_tide_init_install
end
function _tide_init_uninstall --on-event _tide_init_uninstall
set -e $_tide_var_list _tide_var_list $_tide_left_prompt_display_var $_tide_right_prompt_display_var
functions --erase (functions --all | string match --entire --regex '^_tide_')