feat: sync script code

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-08-09 12:17:24 +08:00
parent 18728fc993
commit bce5cdf746
3 changed files with 15 additions and 9 deletions
+14 -5
View File
@@ -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=> " "$@"
}