dotfiles/.functions/common.sh

17 lines
426 B
Bash
Raw Normal View History

2022-07-07 17:09:57 +00:00
function asktobreak(){
if [[ "$ANSWER_YES" == true ]];then
printf "\n"
return 1
fi
printf "Do you want to run this step (y/n)"
while read -r -n 1 -s answer; do
if [[ $answer == [YyNn] ]];then
[[ $answer == [Yy] ]] && return_value=1
[[ $answer == [Nn] ]] && return_value=0
printf "\n"
break;
fi
done
return $return_value
}