Ask for confirmation in install script
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
5c401ac0f6
commit
1c7b6a328a
2 changed files with 52 additions and 34 deletions
|
@ -28,6 +28,7 @@ RED='\033[31m'
|
|||
BLUE='\033[34m'
|
||||
YELLOW='\033[33m'
|
||||
BOLD="$(tput bold)"
|
||||
NORMAL="$(tput sgr0)"
|
||||
|
||||
#######################################
|
||||
# Helper functions
|
||||
|
@ -56,4 +57,15 @@ function print_section() {
|
|||
|
||||
function print_log() {
|
||||
echo -e " • $1"
|
||||
}
|
||||
|
||||
function ask_prompt() {
|
||||
read -p "${BOLD}${1} (y/n): ${NORMAL}" -n 1 -r
|
||||
echo ""
|
||||
|
||||
if [[ ${REPLY} =~ ^[^yY]$ ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue