patch travis_fold and travis_nanoseconds to make it possible to test travis_helper.sh off travis

This commit is contained in:
Dane Springmeyer
2014-11-02 15:44:33 -05:00
parent 2d809127b7
commit 203a42d83a

View File

@@ -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