summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2014-11-02 15:44:33 -0500
committerDane Springmeyer <dane@mapbox.com>2014-11-02 15:44:33 -0500
commit203a42d83a5fdb95774a4c280552ac8cb8256c1f (patch)
treed85b699db38e9a5d1002d37aff8d4f7c1039402a /scripts
parent2d809127b7de072864afce0f502821b0453b2aae (diff)
downloadqtlocation-mapboxgl-203a42d83a5fdb95774a4c280552ac8cb8256c1f.tar.gz
patch travis_fold and travis_nanoseconds to make it possible to test travis_helper.sh off travis
Diffstat (limited to 'scripts')
-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