diff --git a/scripts/lib/color.sh b/scripts/lib/color.sh index 17471bb0d..0259b2643 100755 --- a/scripts/lib/color.sh +++ b/scripts/lib/color.sh @@ -14,6 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +# this script is used to install the dependencies of the project +# +# Usage: `scripts/color.sh`. +################################################################################ + # Define color variables # --- Feature --- COLOR_NORMAL='\033[0m';COLOR_BOLD='\033[1m';COLOR_DIM='\033[2m';COLOR_UNDER='\033[4m'; @@ -54,24 +59,28 @@ blue=$(tput bold; tput setaf 6) timeout=$(if [ "$(uname)" == "Darwin" ]; then echo "1"; else echo "0.1"; fi) # --- helper functions for logs --- -info() +function info() { echo -e "[${GREEN_PREFIX}INFO${COLOR_SUFFIX}] " "$@" } -warn() + +function warn() { echo -e "[${YELLOW_PREFIX}WARN${COLOR_SUFFIX}] " "$@" >&2 } -fatal() + +function fatal() { echo -e "[${RED_PREFIX}ERROR${COLOR_SUFFIX}] " "$@" >&2 exit 1 } -debug() + +function debug() { echo -e "[${BLUE_PREFIX}DEBUG${COLOR_SUFFIX}]===> " "$@" } -success() + +function success() { echo -e "${BRIGHT_GREEN_PREFIX}===> [SUCCESS] <===${COLOR_SUFFIX}\n=> " "$@" } diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index fadc715af..6f314ee67 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -16,7 +16,7 @@ # this script is used to check whether the code is formatted by gofmt or not # # Usage: source scripts/lib/util.sh - +################################################################################ #1、将IP写在一个文件里,比如文件名为hosts_file,一行一个IP地址。 #2、修改ssh-mutual-trust.sh里面的用户名及密码,默认为root用户及密码123。 @@ -832,8 +832,6 @@ function openim::util::run::relative() { done } -trap "echo" EXIT - # input: [10023, 2323, 3434] # output: 10023 2323 3434 diff --git a/scripts/lib/version.sh b/scripts/lib/version.sh index 65f9bb353..04eb89b09 100755 --- a/scripts/lib/version.sh +++ b/scripts/lib/version.sh @@ -12,7 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # ----------------------------------------------------------------------------- # Version management helpers. These functions help to set, save and load the