Change "if" with "case"

Use better syntax for $create in quicknote.
This commit is contained in:
Dimitris Marakomihelakis 2021-01-18 13:28:28 +02:00 committed by GitHub
parent b9ae8de850
commit e6615d892e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,9 +32,9 @@ else
echo -n "Do you want to create one?[Y/N]: " && read create; echo -n "Do you want to create one?[Y/N]: " && read create;
fi fi
if [ $create == "y" ] || [ $create == "Y" ] || [ $create == "yes" ] || [ $create == "YES" ] || [ $create == "Yes" ]; then case $create in Y|Yes|YES|Yes|y )
newnote newnote
fi esac
clear clear
cd $dir cd $dir
@ -53,7 +53,7 @@ function quickread() {
else else
clear clear
echo "No such note." echo "No such note."
cd ~ cd
fi fi
cd $dir cd $dir
} }