2
0
mirror of https://github.com/kazhala/dotbare synced 2024-11-19 15:25:46 +00:00

added confirmation helper

This commit is contained in:
kevin zhuang 2020-04-11 15:32:37 +10:00
parent d8727c7346
commit 3fca553dae

16
helper/get_confirmation Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
#
# confirmaiton helper
#
# @params
# Globals
# ${confirm}: y/n the result of the confirmation
# Arguments
# $1: message to show
function get_confirmation() {
unset confirm
while [[ "${confirm}" != 'y' && "${confirm}" != 'n' ]]; do
read -p "$1(y/n): " confirm
done
}