forked from conda-forge/staged-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging_utils.sh
35 lines (31 loc) · 889 Bytes
/
logging_utils.sh
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
#!/bin/bash
# Provide a unified interface for the different logging
# utilities CI providers offer. If unavailable, provide
# a compatible fallback (e.g. bare `echo xxxxxx`).
function startgroup {
# Start a foldable group of log lines
# Pass a single argument, quoted
case ${CI:-} in
azure )
echo "##[group]$1";;
travis )
echo "$1"
echo -en 'travis_fold:start:'"${1// /}"'\\r';;
github_actions )
echo "::group::$1";;
* )
echo "$1";;
esac
} 2> /dev/null
function endgroup {
# End a foldable group of log lines
# Pass a single argument, quoted
case ${CI:-} in
azure )
echo "##[endgroup]";;
travis )
echo -en 'travis_fold:end:'"${1// /}"'\\r';;
github_actions )
echo "::endgroup::";;
esac
} 2> /dev/null