Fix issue #668
parent
7ffb9e2579
commit
b027a4557f
|
|
@ -230,7 +230,12 @@ _disable-thing ()
|
||||||
do
|
do
|
||||||
plugin=$(basename $f)
|
plugin=$(basename $f)
|
||||||
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
|
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
|
||||||
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
|
cmd_output="$(rm -f $BASH_IT/$subdirectory/enabled/$(basename $plugin) 2>&1)"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf '%s\n' "sorry, an error was encountered when trying to enable the $file_entity $file_type:"
|
||||||
|
echo "${cmd_output}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|
@ -239,7 +244,12 @@ _disable-thing ()
|
||||||
printf '%s\n' "sorry, $file_entity does not appear to be an enabled $file_type."
|
printf '%s\n' "sorry, $file_entity does not appear to be an enabled $file_type."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
|
cmd_output="$(rm -f $BASH_IT/$subdirectory/enabled/$(basename $plugin) 2>&1)"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf '%s\n' "sorry, an error was encountered when trying to enable the $file_entity $file_type:"
|
||||||
|
echo "${cmd_output}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
|
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
|
||||||
|
|
@ -303,7 +313,12 @@ _enable-thing ()
|
||||||
do
|
do
|
||||||
plugin=$(basename $f)
|
plugin=$(basename $f)
|
||||||
if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then
|
if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then
|
||||||
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
|
cmd_output="$(ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin 2>&1)"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf '%s\n' "sorry, an error was encountered when trying to enable the $file_entity $file_type:"
|
||||||
|
echo "${cmd_output}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|
@ -319,9 +334,19 @@ _enable-thing ()
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $BASH_IT/$subdirectory/enabled
|
cmd_output="$(mkdir -p $BASH_IT/$subdirectory/enabled 2>&1)"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf '%s\n' "sorry, an error was encountered when trying to enable the $file_entity $file_type:"
|
||||||
|
echo "${cmd_output}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
|
cmd_output="$(ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin 2>&1)"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf '%s\n' "sorry, an error was encountered when trying to enable the $file_entity $file_type:"
|
||||||
|
echo "${cmd_output}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
|
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue