-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the travis_wait verbose implementation to match the upstream
[skip ci]
- Loading branch information
1 parent
9b127ce
commit 9f65d1d
Showing
3 changed files
with
41 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
unset -f travis_wait | ||
|
||
travis_wait() { | ||
local timeout=$1 | ||
|
||
if [[ $timeout =~ ^[0-9]+$ ]]; then | ||
# looks like an integer, so we assume it's a timeout | ||
shift | ||
else | ||
# default value | ||
timeout=20 | ||
fi | ||
|
||
local cmd="$@" | ||
|
||
$cmd & | ||
local cmd_pid=$! | ||
|
||
travis_jigger $! $timeout $cmd & | ||
local jigger_pid=$! | ||
local result | ||
|
||
{ | ||
wait $cmd_pid 2>/dev/null | ||
result=$? | ||
ps -p$jigger_pid &>/dev/null && kill $jigger_pid | ||
} || return 1 | ||
|
||
if [ $result -eq 0 ]; then | ||
echo -e "\n${ANSI_GREEN}The command \"$TRAVIS_CMD\" exited with $result.${ANSI_RESET}" | ||
else | ||
echo -e "\n${ANSI_RED}The command \"$TRAVIS_CMD\" exited with $result.${ANSI_RESET}" | ||
fi | ||
|
||
return $result | ||
} |
This file was deleted.
Oops, something went wrong.