mirror of https://github.com/kazhala/dotbare
added confirmation helper
parent
d8727c7346
commit
3fca553dae
@ -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
|
||||
}
|
Loading…
Reference in New Issue