mirror of
https://github.com/kazhala/dotbare
synced 2024-11-19 15:25:46 +00:00
added confirmation helper
This commit is contained in:
parent
d8727c7346
commit
3fca553dae
16
helper/get_confirmation
Normal file
16
helper/get_confirmation
Normal 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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user