mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-09 13:43:46 -05:00
minor update
This commit is contained in:
@@ -200,14 +200,14 @@ function is_not_empty() {
|
|||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
|
|
||||||
function type_exists() {
|
function type_exists() {
|
||||||
if [ $(type -P $1) ]; then
|
if [ $(type -P "$1") ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function type_not_exists() {
|
function type_not_exists() {
|
||||||
if [ ! $(type -P $1) ]; then
|
if [ ! $(type -P "$1") ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
@@ -243,16 +243,18 @@ function is_os() {
|
|||||||
|
|
||||||
# Ask the question
|
# Ask the question
|
||||||
function seek_confirmation() {
|
function seek_confirmation() {
|
||||||
printf "\n${bold}$@${reset}"
|
echo ""
|
||||||
|
e_bold "$@"
|
||||||
read -p " (y/n) " -n 1
|
read -p " (y/n) " -n 1
|
||||||
printf "\n"
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# same as above but underlined
|
# same as above but underlined
|
||||||
function seek_confirmation_head() {
|
function seek_confirmation_head() {
|
||||||
printf "\n${underline}${bold}$@${reset}"
|
echo ""
|
||||||
read -p "${underline}${bold} (y/n)${reset} " -n 1
|
e_underline "$@"
|
||||||
printf "\n"
|
read -p " (y/n) " -n 1
|
||||||
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test whether the result of an 'ask' is a confirmation
|
# Test whether the result of an 'ask' is a confirmation
|
||||||
|
|||||||
Reference in New Issue
Block a user