summaryrefslogtreecommitdiffstats
path: root/ci/tools.sh
blob: ecb2e80614bb9434a7024c1ce8b45fd819dd2e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
##############################################################################
# Copyright (c) 2017 Nokia and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

# include only once
[ ! -z "$_tools_included" ] && return || readonly _tools_included=true

#######################################
# Echo printing in yellow bold color
# Arguments:
#   Same as for echo
# Returns:
#   None
#######################################
function echo_info { (
    # don't clutter the script output with the xtrace of the echo command
    { set +x; } 2> /dev/null

    yellow_bold='\033[1;33m'
    color_off='\033[0m'
    echo "${@:1:($#-1)}" -e "$yellow_bold${@: -1}$color_off";
  )
}

#######################################
# Echo error
# Arguments:
#   Same as for echo
# Returns:
#   None
#######################################
function echo_error { (
    # don't clutter the script output with the xtrace of the echo command
    { set +x; } 2> /dev/null

    red_bold='\033[1;31m'
    color_off='\033[0m'
    >&2 echo "${@:1:($#-1)}" -e "$red_bold${@: -1}$color_off";
  )
}