parent
5c66f478dd
commit
aa9a63a10e
|
|
@ -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 ()
|
||||
|
|
|
|||
|
|
@ -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" ]
|
||||
|
|
|
|||
Loading…
Reference in New Issue