feat(util): add common bash function as util
This commit is contained in:
parent
a65651289e
commit
75d7c6aadc
20
utils/common.sh
Normal file
20
utils/common.sh
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user