Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fixed some shellcheck warnings
Browse files Browse the repository at this point in the history
Also fixed one broken case of `unset`.
  • Loading branch information
nwinkler committed May 31, 2018
1 parent 0028dc7 commit 5d99d6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions bash_it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ then
# Setting $BASH to maintain backwards compatibility
# TODO: warn users that they should upgrade their .bash_profile
export BASH_IT=$BASH
export BASH="$(bash -c 'echo $BASH')"
BASH="$(bash -c 'echo $BASH')"
export BASH
fi

# For backwards compatibility, look in old BASH_THEME location
if [ -z "$BASH_IT_THEME" ];
then
# TODO: warn users that they should upgrade their .bash_profile
export BASH_IT_THEME="$BASH_THEME";
unset $BASH_THEME;
unset BASH_THEME;
fi

# Load composure first, so we support function metadata
Expand All @@ -30,9 +31,9 @@ LIB="${BASH_IT}/lib/*.bash"
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
for config_file in $LIB
do
if [ $config_file != $APPEARANCE_LIB ]; then
if [ "$config_file" != "$APPEARANCE_LIB" ]; then
# shellcheck disable=SC1090
source $config_file
source "$config_file"
fi
done

Expand All @@ -57,7 +58,7 @@ source "${BASH_IT}/themes/base.theme.bash"

# appearance (themes) now, after all dependencies
# shellcheck source=./lib/appearance.bash
source $APPEARANCE_LIB
source "$APPEARANCE_LIB"

# Load custom aliases, completion, plugins
for file_type in "aliases" "completion" "plugins"
Expand All @@ -75,7 +76,7 @@ for config_file in $CUSTOM
do
if [ -e "${config_file}" ]; then
# shellcheck disable=SC1090
source $config_file
source "$config_file"
fi
done

Expand Down
2 changes: 1 addition & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ esac
BACKUP_FILE=$CONFIG_FILE.bak

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" &&
mv "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.uninstall" &&
Expand Down

0 comments on commit 5d99d6c

Please sign in to comment.