Skip to content

Commit 66e0910

Browse files
Merge pull request #288 from guimochila/master
fix: emulate timeout command for OSX
2 parents 6999a95 + 297cc98 commit 66e0910

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/weather.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ fahrenheit=$1
66
location=$2
77
fixedlocation=$3
88

9+
# emulate timeout command from bash - timeout is not available by default on OSX
10+
if [ "$(uname)" == "Darwin" ]; then
11+
timeout() {
12+
perl -e 'alarm shift; exec @ARGV' "$duration" "$@"
13+
}
14+
fi
15+
916
display_location()
1017
{
1118
if $location && [[ ! -z "$fixedlocation" ]]; then

0 commit comments

Comments
 (0)