portainer-devtool/utils/common.sh

31 lines
539 B
Bash
Raw Normal View History

#!/bin/bash
TRUE=0;
FALSE=1;
ERROR_COLOR='\033[0;31m';
HIGHLIGHT_COLOR='\033[0;32m';
INPUT_COLOR='\033[0;33m';
NO_COLOR='\033[0m';
function print_highlight() {
printf "${HIGHLIGHT_COLOR}$1${NO_COLOR}\n"
}
function print_error() {
printf "${ERROR_COLOR}$1${NO_COLOR}\n"
}
function input() {
read -p "$(echo -e ${INPUT_COLOR}$1 ${NO_COLOR})" $2
}
function prompt_continue() {
read -p "Continue N/(Y)?" is_continue
if [[ "${is_continue}" == "N" || "${is_continue}" == "n" ]]; then
return $FALSE;
fi
return $TRUE;
}