Add init script

This commit is contained in:
John Zhao
2018-03-09 10:51:09 +08:00
parent 7f8de0b03c
commit f4245fd50f
6 changed files with 169 additions and 5 deletions

View File

@@ -18,6 +18,10 @@ _detect() {
fi
}
_detect_cmd() {
[ -x "$(command -v $1)" ]
}
_detect_fn() {
[ `type -t $1`"" == "function" ]
}

View File

@@ -21,6 +21,7 @@ COLOR_INFO="1;34" # Blue
COLOR_DONE="1;32" # Green
COLOR_ERROR="1;31" # Red
# action colors
COLOR_STRONG_NORMAL="35"
COLOR_INFO_NORMAL="34"
COLOR_DONE_NORMAL="32"
COLOR_ERROR_NORMAL="31"
@@ -57,6 +58,10 @@ _echo_e() {
_echo_e_ "$1" "$COLOR_ERROR"
}
_echo_sn() {
_echo_ "$1" "$COLOR_STRONG_NORMAL"
}
_echo_in() {
_echo_ "$1" "$COLOR_INFO_NORMAL"
}