summaryrefslogtreecommitdiff
path: root/scripts/travis_helper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/travis_helper.sh')
-rwxr-xr-xscripts/travis_helper.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/travis_helper.sh b/scripts/travis_helper.sh
index 040ef29443..c42ce215e3 100755
--- a/scripts/travis_helper.sh
+++ b/scripts/travis_helper.sh
@@ -32,6 +32,26 @@ function mapbox_time {
mapbox_time_finish $name $timer_id
}
+if [[ "${TRAVIS_COMMIT:-false}" == false ]]; then
+function travis_fold {
+ local action=$1
+ local name=$2
+ echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
+}
+function travis_nanoseconds {
+ local cmd="date"
+ local format="+%s%N"
+ local os=$(uname)
+
+ if hash gdate > /dev/null 2>&1; then
+ cmd="gdate" # use gdate if available
+ elif [[ "$os" = Darwin ]]; then
+ format="+%s000000000" # fallback to second precision on darwin (does not support %N)
+ fi
+
+ $cmd -u $format
+}
+fi
export ANSI_CLEAR
export -f travis_fold