mirror of
https://github.com/nwg-piotr/nwg-shell.git
synced 2024-10-03 17:47:54 +03:00
fix yes_or_no
function
This commit is contained in:
parent
72aca9284d
commit
aabe39c0d5
@ -5,12 +5,15 @@ if [ "$(id -u)" == 0 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Don't continue script if any error occurs.
|
||||
set -e
|
||||
|
||||
function yes_or_no {
|
||||
while true; do
|
||||
read -r -p "$* [y/n]: " yn
|
||||
case $yn in
|
||||
[Yy]*) choice="Y" ; return 0 ;;
|
||||
[Nn]*) choice="n" ; return 1 ;;
|
||||
[Nn]*) choice="n" ; return 0 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user