diff --git a/install.sh b/install.sh index e4419acf3c..00342bfcbf 100755 --- a/install.sh +++ b/install.sh @@ -203,8 +203,8 @@ source "${BASH_IT}/lib/log.bash" source "${BASH_IT?}/lib/utilities.bash" # shellcheck source-path=SCRIPTDIR/lib source "${BASH_IT?}/lib/helpers.bash" -# shellcheck source-path=SCRIPTDIR/themes -source "${BASH_IT?}/themes/colors.theme.bash" +# shellcheck source-path=SCRIPTDIR/lib +source "${BASH_IT?}/lib/colors.bash" if [[ -n $interactive && -z "${silent}" ]]; then for type in "aliases" "plugins" "completion"; do diff --git a/lib/helpers.bash b/lib/helpers.bash index 66cdec74f2..606c09308e 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -572,7 +572,7 @@ _bash-it-profile-load-parse-profile() { break fi # Do not actually modify config on dry run - [[ -z $2 ]] || continue + [[ -z ${2:-} ]] || continue # Actually enable the component $enable_func "$component" done < "$1" @@ -704,7 +704,9 @@ function _on-disable-callback() { _group 'lib' local callback="${1}_on_disable" - _command_exists "$callback" && "$callback" + if _command_exists "$callback"; then + "$callback" + fi } function _disable-all() { @@ -723,8 +725,8 @@ function _disable-plugin() { _example '$ disable-plugin rvm' _group 'lib' - _disable-thing "plugins" "plugin" "$1" - _on-disable-callback "$1" + _disable-thing "plugins" "plugin" "${1?}" + _on-disable-callback "${1?}" } function _disable-alias() { @@ -733,7 +735,7 @@ function _disable-alias() { _example '$ disable-alias git' _group 'lib' - _disable-thing "aliases" "alias" "$1" + _disable-thing "aliases" "alias" "${1?}" } function _disable-completion() { @@ -742,7 +744,7 @@ function _disable-completion() { _example '$ disable-completion git' _group 'lib' - _disable-thing "completion" "completion" "$1" + _disable-thing "completion" "completion" "${1?}" } function _disable-thing() { @@ -776,7 +778,7 @@ function _disable-thing() { # Either one will be matched by this glob for plugin in "${BASH_IT}/enabled"/[[:digit:]][[:digit:]][[:digit:]]"${BASH_IT_LOAD_PRIORITY_SEPARATOR}${file_entity}.${suffix}.bash" "${BASH_IT}/$subdirectory/enabled/"{[[:digit:]][[:digit:]][[:digit:]]"${BASH_IT_LOAD_PRIORITY_SEPARATOR}${file_entity}.${suffix}.bash","${file_entity}.${suffix}.bash"}; do if [[ -e "${plugin}" ]]; then - rm "${plugin}" + rm -f "${plugin}" plugin= break fi @@ -789,8 +791,9 @@ function _disable-thing() { _bash-it-clean-component-cache "${file_type}" - if [[ "$file_entity" = "all" ]]; then - printf '%s\n' "$file_entity $(_bash-it-pluralize-component "$file_type") disabled." + if [[ "$file_entity" == "all" ]]; then + _bash-it-component-pluralize "${file_type}" + printf '%s\n' "$file_entity ${_bash_it_component_pluralize?} disabled." else printf '%s\n' "$file_entity disabled." fi