oh-my-fish / plugin-weather

A simple, location-aware weather command for Fish
MIT License
31 stars 15 forks source link

Error on macOS #17

Closed lukasmalkmus closed 7 years ago

lukasmalkmus commented 7 years ago

Running weather without an argument gives me the following error:

test returned eval errors:
        invalid integer ''
Array index out of bounds
~/.local/share/omf/pkg/weather/functions/weather.fish (line 1): weather.fetch "http://api.openweathermap.org/data/2.5/weather" lat=$location[1] lon=$location[2] APPID=$api_key
                                                                                                                                                              ^
in command substitution
        called on line 0 of file ~/.local/share/omf/pkg/weather/functions/weather.fish

in function 'weather'
        called on standard input

Unable to fetch weather data; please try again later.

I expected weather to use my IP address to determine my location.

sagebind commented 7 years ago

Looks like a bug introduced caused by Fish 2.5 changing how array indexing is handled.

lukasmalkmus commented 7 years ago

Ah. That's why the wind isn't working, either:

Weather for Wellington, NZ

Temperature: 13.00 °C (55.40 °F)
   Humidity: 100%
 Cloudiness: light rain
   Pressure: 1000 hpa
       Wind: from S (210°) at 11.8 m/stest returned eval errors:
        invalid integer 'null'

5-day forecast
  Temperature: ▂▂▂▄▄▆▆▄▂▂▄▄▆▆▄▄▂▂▂▄▄▂▂▂▂▁▂▄▄▄▄▄▄▄▆███▆▆
               05/04  06/04  07/04  08/04  09/04  10/04  

Precipitation: ██▅▁▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
               05/04  06/04  07/04  08/04  09/04  10/04  
alicoding commented 7 years ago

Any update on this?

sagebind commented 7 years ago

Sorry for the delay, this issue kind of got lost. This should be fixed in the latest master now, which you should be able to get with omf update weather.

matrixraven commented 6 years ago

Still broken (or broken again). Using fish 2.7.0 and just today installed with omf install weather. Getting the exact same error as originally listed above.