mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
729 B
Bash
33 lines
729 B
Bash
8 years ago
|
ANSI_RED="\033[31;1m"
|
||
|
ANSI_GREEN="\033[32;1m"
|
||
|
ANSI_RESET="\033[0m"
|
||
|
ANSI_CLEAR="\033[0K"
|
||
|
|
||
|
travis_retry() {
|
||
|
local result=0
|
||
|
local count=1
|
||
|
while [ $count -le 3 ]; do
|
||
|
[ $result -ne 0 ] && {
|
||
|
echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2
|
||
|
}
|
||
|
"$@"
|
||
|
result=$?
|
||
|
[ $result -eq 0 ] && break
|
||
|
count=$(($count + 1))
|
||
|
sleep 1
|
||
|
done
|
||
|
|
||
|
[ $count -gt 3 ] && {
|
||
|
echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2
|
||
|
}
|
||
|
|
||
|
return $result
|
||
|
}
|
||
|
|
||
|
export PATH=$PWD/bin:$PATH
|
||
|
export PATH=$PATH:${TRAVIS_BUILD_DIR}/install/bin
|
||
|
if [ -f ${TRAVIS_BUILD_DIR}/install/bin/luarocks ]; then
|
||
|
# add local rocks to $PATH
|
||
|
eval $(luarocks path --bin)
|
||
|
fi
|