change order of checking shopt nocasematch

This commit is contained in:
robocopAlpha 2020-08-04 13:50:33 +03:00
parent 6889284f6b
commit 6296379a55

View file

@ -15,14 +15,14 @@ if [ -w /usr/local/bin ]; then
brewlog has been installed as $(command -v brewlog). brewlog has been installed as $(command -v brewlog).
You can start with brewlog --help %s\n" You can start with brewlog --help %s\n"
else else
curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/brewlog.sh' >| brewlog.sh
echo "user $(whoami) cannot write to $BREWLOCATION"
read -r -p "use sudo (y/N): " choice
shopt -q nocasematch; shopt -q nocasematch;
if [ "$?" -eq "1" ]; then if [ "$?" -eq "1" ]; then
shopt -s nocasematch shopt -s nocasematch
flag=1 flag=1
fi fi
curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/brewlog.sh' >| brewlog.sh
echo "user $(whoami) cannot write to $BREWLOCATION"
read -r -p "use sudo (y/N): " choice
if [[ "$choice" =~ ^(yes|y)$ ]] if [[ "$choice" =~ ^(yes|y)$ ]]
then then
sudo mv brewlog.sh $BREWLOCATION/brewlog sudo mv brewlog.sh $BREWLOCATION/brewlog