Merge pull request #1200 from nwinkler/shellcheck-fixes

Shellcheck fixes
pull/1202/head
Nils Winkler 2018-06-01 08:22:44 +02:00 committed by GitHub
commit e51c6ad960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -7,7 +7,8 @@ then
# Setting $BASH to maintain backwards compatibility # Setting $BASH to maintain backwards compatibility
# TODO: warn users that they should upgrade their .bash_profile # TODO: warn users that they should upgrade their .bash_profile
export BASH_IT=$BASH export BASH_IT=$BASH
export BASH="$(bash -c 'echo $BASH')" BASH="$(bash -c 'echo $BASH')"
export BASH
fi fi
# For backwards compatibility, look in old BASH_THEME location # For backwards compatibility, look in old BASH_THEME location
@ -15,7 +16,7 @@ if [ -z "$BASH_IT_THEME" ];
then then
# TODO: warn users that they should upgrade their .bash_profile # TODO: warn users that they should upgrade their .bash_profile
export BASH_IT_THEME="$BASH_THEME"; export BASH_IT_THEME="$BASH_THEME";
unset $BASH_THEME; unset BASH_THEME;
fi fi
# Load composure first, so we support function metadata # Load composure first, so we support function metadata
@ -30,9 +31,9 @@ LIB="${BASH_IT}/lib/*.bash"
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash" APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
for config_file in $LIB for config_file in $LIB
do do
if [ $config_file != $APPEARANCE_LIB ]; then if [ "$config_file" != "$APPEARANCE_LIB" ]; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source $config_file source "$config_file"
fi fi
done done
@ -57,7 +58,7 @@ source "${BASH_IT}/themes/base.theme.bash"
# appearance (themes) now, after all dependencies # appearance (themes) now, after all dependencies
# shellcheck source=./lib/appearance.bash # shellcheck source=./lib/appearance.bash
source $APPEARANCE_LIB source "$APPEARANCE_LIB"
# Load custom aliases, completion, plugins # Load custom aliases, completion, plugins
for file_type in "aliases" "completion" "plugins" for file_type in "aliases" "completion" "plugins"
@ -75,7 +76,7 @@ for config_file in $CUSTOM
do do
if [ -e "${config_file}" ]; then if [ -e "${config_file}" ]; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source $config_file source "$config_file"
fi fi
done done

View File

@ -16,7 +16,7 @@ esac
BACKUP_FILE=$CONFIG_FILE.bak BACKUP_FILE=$CONFIG_FILE.bak
if [ ! -e "$HOME/$BACKUP_FILE" ]; then if [ ! -e "$HOME/$BACKUP_FILE" ]; then
echo -e "\033[0;33mBackup file "$HOME/$BACKUP_FILE" not found.\033[0m" >&2 echo -e "\033[0;33mBackup file $HOME/$BACKUP_FILE not found.\033[0m" >&2
test -w "$HOME/$CONFIG_FILE" && test -w "$HOME/$CONFIG_FILE" &&
mv "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.uninstall" && mv "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.uninstall" &&