Improve askok

This commit is contained in:
2023-02-16 13:16:27 -05:00
parent 81cd5c0880
commit 42cbbd43c3

View File

@@ -663,10 +663,10 @@ fromSource() {
# Generic helpers # Generic helpers
debug() { (( DEBUG )) && echo "Debug: $*"; } debug() { (( DEBUG )) && echo "Debug: $*"; }
askOk() { askOk() {
local _response local r
read -r -p "$* [y/N]" _response read -r -p "$* [y/N]" r
_response=${_response,,} r=${r,,}
[[ "$_response" =~ ^(yes|y)$ ]] [[ "$r" =~ ^(yes|y)$ ]]
} }
extract() { extract() {
debug "${FUNCNAME[0]}" debug "${FUNCNAME[0]}"