Commit 2c1e1cc7 authored by jaster's avatar jaster

bin/dev.sh: Improve shell detection

Shell detection used hardcoded paths that made it fail when using
distributions using a different scheme (e.g. debian-based distros).

Improve shell detection by using a glob-based comparison, where we do
not assume any specific path leading to the shell binary.
parent bd1d38ff
......@@ -16,19 +16,21 @@ echo "alias memopol-launch=\"memopol-code && memopol runserver\"" >> $ALIASROOT
echo "alias memopol-update-all=\"memopol-code && bin/update-all\"" >> $ALIASROOT
echo "alias memopol-refresh-scores=\"memopol-code && memopol refresh_scores\"" >> $ALIASROOT
if [ $SHELL = "/bin/bash" ]
then
case $SHELL in
*/bash)
echo "Bash detected"
echo "Update $HOME/.bashrc file"
RCSHELL="$HOME/.bashrc"
elif [ $SHELL = "/bin/zsh" ]
then
echo "Zsh detected"
echo "Update $HOME/.zshrc file"
RCSHELL="$HOME/.zshrc"
else
RCSHELL="$HOME/.bashrc"
;;
*/zsh)
echo "Zsh detected"
echo "Update $HOME/.zshrc file"
RCSHELL="$HOME/.zshrc"
;;
*)
echo "SHELL don't supported. Try using BASH or ZSH, or manually."
fi
;;
esac
echo "source $ALIASROOT" >> $RCSHELL
source $ALIASROOT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment