Added message after migrating about possible fixes.

See #985 for background.
pull/1043/head
Nils Winkler 2017-09-15 08:10:17 +02:00
parent 5c66f478dd
commit aa9a63a10e
2 changed files with 14 additions and 2 deletions

View File

@ -187,6 +187,9 @@ _bash-it-migrate() {
_about 'migrates Bash-it configuration from a previous format to the current one'
_group 'lib'
declare migrated_something
migrated_something=false
for file_type in "aliases" "plugins" "completion"
do
for f in `sort <(compgen -G "${BASH_IT}/$file_type/enabled/*.bash")`
@ -198,6 +201,8 @@ _bash-it-migrate() {
# Cut off the optional "250---" prefix and the suffix
typeset component_name=$(echo $ff | sed -e 's/[0-9]*[-]*\(.*\)\..*\.bash/\1/g')
migrated_something=true
echo "Migrating $single_type $component_name."
disable_func="_disable-$single_type"
@ -207,6 +212,11 @@ _bash-it-migrate() {
$enable_func $component_name
done
done
if [ "$migrated_something" = "true" ]; then
echo ""
echo "If any migration errors were reported, please try the following: reload && bash-it migrate"
fi
}
_bash-it-describe ()

View File

@ -391,7 +391,8 @@ function __migrate_all_components() {
assert_line "0" 'Migrating plugin nvm.'
assert_line "1" 'nvm disabled.'
assert_line "2" 'nvm enabled with priority 225.'
assert_line "3" 'node enabled with priority 250.'
assert_line "3" 'If any migration errors were reported, please try the following: reload && bash-it migrate'
assert_line "4" 'node enabled with priority 250.'
assert [ ! -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
assert [ -L "$BASH_IT/enabled/250---node.plugin.bash" ]
@ -410,7 +411,8 @@ function __migrate_all_components() {
assert_line "3" 'Migrating plugin nvm.'
assert_line "4" 'nvm disabled.'
assert_line "5" 'nvm enabled with priority 225.'
assert_line "6" 'node disabled.'
assert_line "6" 'If any migration errors were reported, please try the following: reload && bash-it migrate'
assert_line "7" 'node disabled.'
assert [ ! -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
assert [ ! -L "$BASH_IT/plugins/enabled/250---node.plugin.bash" ]