2#===============================================================================
6# DESCRIPTION: Common functions for servant's shell scripts
7# Meant to be sourced rather than run.
9# REQUIREMENTS: bash >= 4
10#===============================================================================
13DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
17SOURCES_TXT="$( dirname $DIR)/sources.txt"
19TRAVIS=${TRAVIS:-false}
22SOURCES=$(awk -F= '{print $1}' "$SOURCES_TXT")
24join () { local IFS="$1"; shift; echo "$*"; }
27 local NUM=$(cd "$ROOT" && find . -name 'servant*.cabal' | xargs grep "^version:" | awk '{ print $2 }' | uniq -c | wc -l)
28 if [ 1 -eq $NUM ] ; then
31 echo "versions of packages are not all the same!" && exit 1
37 # https://github.com/travis-ci/travis-build/blob/18bd04e965b9bfaa49cd6bdcd8dcb1513b8d2fcd/lib/travis/build/templates/header.sh
40 while [ $count -le 3 ]; do
41 [ $result -ne 0 ] && {
42 echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2
46 [ $result -eq 0 ] && break
52 echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list