mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-30 14:59:31 +00:00
image_builder: split image_config.sh & standardization headers
This commit is contained in:
26
image_builder/echo_stamp.sh
Normal file
26
image_builder/echo_stamp.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
#
|
||||
# Script for image configure
|
||||
# @urpylka Artem Smirnov
|
||||
#
|
||||
|
||||
echo_stamp() {
|
||||
# TEMPLATE: echo_stamp <TEXT> <TYPE>
|
||||
# TYPE: SUCCESS, ERROR, INFO
|
||||
|
||||
# More info there https://www.shellhacks.com/ru/bash-colors/
|
||||
|
||||
TEXT="$(date) | $1"
|
||||
TEXT="\e[1m$TEXT\e[0m" # BOLD
|
||||
|
||||
case "$2" in
|
||||
SUCCESS)
|
||||
TEXT="\e[32m${TEXT}\e[0m";; # GREEN
|
||||
ERROR)
|
||||
TEXT="\e[31m${TEXT}\e[0m";; # RED
|
||||
*)
|
||||
TEXT="\e[34m${TEXT}\e[0m";; # BLUE
|
||||
esac
|
||||
echo -e ${TEXT}
|
||||
}
|
||||
Reference in New Issue
Block a user