timeout command not on macOS
Seems like timeout is not available on macOS
wait-for-it.sh www.google.com:443 --timeout=10 -- echo "its up"
readlink: illegal option -- f
usage: readlink [-n] [file ...]
./scripts/wait-for-it.sh: line 58: timeout: command not found
wait-for-it.sh: timeout occurred after waiting 10 seconds for www.google.com:443
its up
brew install coreutils
alias timeout=gtimeout
🎉
@twistezo This doesn't really solve the issue, as wait-for-it is supposed to be a standalone executable
@deiga wait-for-it is a bash script, so it depends on the packages you have installed. If you're looking for a standalone executable, you can check out wait-for-it - a binary executable built in golang
@roerohan Sure, it's a bash script, but are any of the packages it uses not system defaults?
@deiga I'm not sure about how it works on mac, I'm hoping someone else can answer. Also it's been really long so I'm assuming you might have figured it out 😛
same question. it's not working on mac
We do our development on Mac and deploy to Linux. I need to be able to run locally before I commit, so Linux only is a problem. Is there an alternative solution?
I added this to the beginning of the script. Works on mac for local dev and linux for ci
if [[ $OSTYPE == 'darwin'* ]]; then
if ! command -v gtimeout &> /dev/null
then
echo "missing gtimeout (`brew install coreutils`)"
exit
fi
alias timeout=gtimeout
fi