-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
This code is the exact same in more than 4 files:
if [[ $SHELL_EXTENSION == "bash" ]]
then
WSDIR=$(readlink -f $(dirname $(dirname "${BASH_SOURCE[0]}")))
elif [[ $SHELL_EXTENSION == "zsh" ]]
then
WSDIR="$(dirname $(readlink -f ${0%/*}))";
else
echo "This shell is not supported. Please use bash or zsh."
exit -1 # Not permitted
fi
Later modification will become difficult to do correctly if it stays
Maybe source a separate file containing the identical code or use an external function.