Skip to content

Commit

Permalink
fix: emulate timeout command for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhermeScaldelai-TomTom committed Sep 9, 2024
1 parent 6999a95 commit 9cabcc3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/weather.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cabcc3

Please sign in to comment.