fcambus / ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
BSD 2-Clause "Simplified" License
1.88k stars 145 forks source link

ERROR: Cannot fetch weather data when using ansiweatherrc #157

Closed thirota closed 1 month ago

thirota commented 2 months ago

Summary

Ansiweather script fails when using the config file.

% cat ~/.ansiweatherrc 
location:Tokyo

% ./ansiweather
ERROR: Cannot fetch weather data

Environment

I would like to create a pull request, but I'm not sure whether the color option is available for every linux distribution. So, I will report this problem as an issue.

Thanks.

Taka

chicks-net commented 1 month ago

I'm on the same version of ansiweather and also on Sonoma and I don't have any issues. I installed ansiweather via homebrew. I tried your config file also:

% cat ~/.ansiweatherrc
location:Tokyo

and it worked for me.

 Weather in Tokyo: 28 °C - UVI: 7.69 - Wind: 3.6 m/s WSW - Humidity: 85% - Pressure: 1013 hPa
thirota commented 1 month ago

@chicks-net Thanks for your comment.

I apologize for the lack of explanation in the Environment section. I have an environment variable on my MacBook Air:

% env | grep GREP
GREP_OPTIONS=--color=always

On my other MacBook Pro, the ansiweather script works as expected, and it does not have GREP_OPTIONS.

This issue appears to depend on my local environment settings.

chicks-net commented 1 month ago

Thanks for explaining the GREP_OPTIONS issue again. I missed that variable being set in the original issue.

It might be good for ansiweather to internally set GREP_OPTIONS to a value that isn't problematic. It wouldn't override your usage of that option in the interactive shell.