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
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE
3 changed files with 15 additions and 9 deletions

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=> " "$@"
}

View File

@ -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

View File

@ -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