ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
Log | Files | Refs | README | LICENSE

commit 96322e9f7a8a55575abba11e52fc4133c9b448fd
parent 1bf0200d33d84187b22efcd9aafea09075452e8d
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sat, 23 Nov 2013 06:53:15 -0800

Merge pull request #37 from andreineculau/patch-2

Change detection of BSD vs GNU date
Diffstat:
Mansiweather | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ansiweather b/ansiweather @@ -144,10 +144,12 @@ weather=$($fetch_cmd "http://api.openweathermap.org/data/2.5/$api_cmd?q=$locatio function epoch_to_date { unamestr=$(uname) - if [[ "$unamestr" == 'Linux' ]]; then - ret=$(date -d @$1 +"%a %b %d") - else + if date -j -r $1 +"%a %b %d" > /dev/null 2>&1; then + # BSD ret=$(date -j -r $1 +"%a %b %d") + else + # GNU + ret=$(date -d @$1 +"%a %b %d") fi echo $ret }