#!/usr/bin/env bash

# Prevent bootstrapping failure due to unrecognized flag:
# https://github.com/pantsbuild/pants/issues/78
function set_archflags() {
  GCC_VERSION=`gcc -v 2>&1`
  if [[ "$GCC_VERSION" == *503.0.38* ]]; then
    # Required for clang version 503.0.38
    export set ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
  fi
}
set_archflags


function log() {
  echo -e "$@" 1>&2
}

function die() {
  (($# > 0)) && log "\n$@"
  exit 1
}

function banner() {
  echo
  echo "[== $@ ==]"
  echo
}

#!/usr/bin/env bash

# Prevent bootstrapping failure due to unrecognized flag:
# https://github.com/pantsbuild/pants/issues/78
function set_archflags() {
  GCC_VERSION=`gcc -v 2>&1`
  if [[ "$GCC_VERSION" == *503.0.38* ]]; then
    # Required for clang version 503.0.38
    export set ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
  fi
}
set_archflags


function log() {
  echo -e "$@" 1>&2
}

function die() {
  (($# > 0)) && log "\n$@"
  exit 1
}

# Initialization for elapsed()
if [ -z "$elapsed_start_time" ] ; then
  export elapsed_start_time=$(date +'%s')
fi

function elapsed() {
  now=$(date '+%s')
  elapsed_secs=$(($now - $elapsed_start_time))
  echo $elapsed_secs | awk '{printf "%02d:%02d\n",int($1/60), int($1%60)}'
}

function banner() {
  echo
  echo "[== $(elapsed) $@ ==]"
  echo
}

Add an elapsed timestamp to the banner for CI.
Add an elapsed timestamp to the banner for CI.

Looks like:

```
[== 00:00 Banner message ==]
```

Testing Done:
See: https://travis-ci.org/pantsbuild/pants/jobs/50841075 for example output

Bugs closed: 1109

Reviewed at https://rbcommons.com/s/twitter/r/1775/
