From 297cc98fd7779abf4e0fa0993332ff5bcd37809e Mon Sep 17 00:00:00 2001 From: Guilherme Date: Mon, 9 Sep 2024 06:46:06 +0200 Subject: [PATCH] fix: emulate timeout command for OSX --- scripts/weather.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/weather.sh b/scripts/weather.sh index 4b56c55f..26b45f3b 100755 --- a/scripts/weather.sh +++ b/scripts/weather.sh @@ -6,6 +6,13 @@ fahrenheit=$1 location=$2 fixedlocation=$3 +# emulate timeout command from bash - timeout is not available by default on OSX +if [ "$(uname)" == "Darwin" ]; then + timeout() { + perl -e 'alarm shift; exec @ARGV' "$duration" "$@" + } +fi + display_location() { if $location && [[ ! -z "$fixedlocation" ]]; then