Skip to content

Commit 5d99d6c

Browse files
committed
Fixed some shellcheck warnings
Also fixed one broken case of `unset`.
1 parent 0028dc7 commit 5d99d6c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

bash_it.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ then
77
# Setting $BASH to maintain backwards compatibility
88
# TODO: warn users that they should upgrade their .bash_profile
99
export BASH_IT=$BASH
10-
export BASH="$(bash -c 'echo $BASH')"
10+
BASH="$(bash -c 'echo $BASH')"
11+
export BASH
1112
fi
1213

1314
# For backwards compatibility, look in old BASH_THEME location
1415
if [ -z "$BASH_IT_THEME" ];
1516
then
1617
# TODO: warn users that they should upgrade their .bash_profile
1718
export BASH_IT_THEME="$BASH_THEME";
18-
unset $BASH_THEME;
19+
unset BASH_THEME;
1920
fi
2021

2122
# Load composure first, so we support function metadata
@@ -30,9 +31,9 @@ LIB="${BASH_IT}/lib/*.bash"
3031
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
3132
for config_file in $LIB
3233
do
33-
if [ $config_file != $APPEARANCE_LIB ]; then
34+
if [ "$config_file" != "$APPEARANCE_LIB" ]; then
3435
# shellcheck disable=SC1090
35-
source $config_file
36+
source "$config_file"
3637
fi
3738
done
3839

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

5859
# appearance (themes) now, after all dependencies
5960
# shellcheck source=./lib/appearance.bash
60-
source $APPEARANCE_LIB
61+
source "$APPEARANCE_LIB"
6162

6263
# Load custom aliases, completion, plugins
6364
for file_type in "aliases" "completion" "plugins"
@@ -75,7 +76,7 @@ for config_file in $CUSTOM
7576
do
7677
if [ -e "${config_file}" ]; then
7778
# shellcheck disable=SC1090
78-
source $config_file
79+
source "$config_file"
7980
fi
8081
done
8182

uninstall.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ esac
1616
BACKUP_FILE=$CONFIG_FILE.bak
1717

1818
if [ ! -e "$HOME/$BACKUP_FILE" ]; then
19-
echo -e "\033[0;33mBackup file "$HOME/$BACKUP_FILE" not found.\033[0m" >&2
19+
echo -e "\033[0;33mBackup file $HOME/$BACKUP_FILE not found.\033[0m" >&2
2020

2121
test -w "$HOME/$CONFIG_FILE" &&
2222
mv "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.uninstall" &&

0 commit comments

Comments
 (0)