test existence, not symlink
it isn't safe to assume that symlinks created in the enabled/* dirs will
be symlinks later...
some users use tools like Dropbox to sync their files across systems,
and these may transform symlinks into regular files. explicitly
checking for symlinks with tests like [ -h $file ] will break on these
systems. these tests have been replaced with [ -e $file ] instead.
diff --git a/lib/helpers.bash b/lib/helpers.bash
index ad0cfd6..d0c16b8 100644
--- a/lib/helpers.bash
+++ b/lib/helpers.bash
@@ -39,7 +39,7 @@
printf "%-20s%-10s%s\n" 'Plugin' 'Enabled?' 'Description'
for f in $BASH_IT/plugins/available/*.bash
do
- if [ -h $BASH_IT/plugins/enabled/$(basename $f) ]; then
+ if [ -e $BASH_IT/plugins/enabled/$(basename $f) ]; then
enabled='x'
else
enabled=' '
@@ -69,7 +69,7 @@
for f in $BASH_IT/plugins/available/*.bash
do
plugin=$(basename $f)
- if [ -h $BASH_IT/plugins/enabled/$plugin ]; then
+ if [ -e $BASH_IT/plugins/enabled/$plugin ]; then
rm $BASH_IT/plugins/enabled/$(basename $plugin)
fi
done
@@ -114,7 +114,7 @@
fi
plugin=$(basename $plugin)
- if [ -h $BASH_IT/plugins/enabled/$plugin ]; then
+ if [ -e $BASH_IT/plugins/enabled/$plugin ]; then
printf '%s\n' "$1 is already enabled."
return
fi