• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# $1 - start or end
2# $2 - fold identifier, no spaces
3# $3 - fold section description
4travis_fold() {
5  local YELLOW='\033[1;33m'
6  local NOCOLOR='\033[0m'
7  if [ -z ${GITHUB_WORKFLOW+x} ]; then
8    echo travis_fold:$1:$2
9    if [ ! -z "${3:-}" ]; then
10      echo -e "${YELLOW}$3${NOCOLOR}"
11    fi
12    echo
13  else
14    if [ $1 = "start" ]; then
15      line="::group::$2"
16      if [ ! -z "${3:-}" ]; then
17        line="$line - ${YELLOW}$3${NOCOLOR}"
18      fi
19    else
20      line="::endgroup::"
21    fi
22    echo -e "$line"
23  fi
24}
25
26__print() {
27  local TITLE=""
28  if [[ -n $2 ]]; then
29      TITLE=" title=$2"
30  fi
31  echo "::$1${TITLE}::$3"
32}
33
34# $1 - title
35# $2 - message
36print_error() {
37  __print error $1 $2
38}
39
40# $1 - title
41# $2 - message
42print_notice() {
43  __print notice $1 $2
44}
45