From 75d7c6aadcc37ab5f7fefbc7c5ca8b56ca9dc6a2 Mon Sep 17 00:00:00 2001 From: oscar Date: Thu, 11 Aug 2022 22:57:16 +1200 Subject: [PATCH] feat(util): add common bash function as util --- utils/common.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils/common.sh diff --git a/utils/common.sh b/utils/common.sh new file mode 100644 index 0000000..b736d58 --- /dev/null +++ b/utils/common.sh @@ -0,0 +1,20 @@ +#!/bin/bash + + +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 +} \ No newline at end of file