aboutsummaryrefslogtreecommitdiffstats
path: root/bin/weather-fetch.sh
AgeCommit message (Collapse)AuthorFilesLines
2026-09-17fix: let the shellcheck directive bind to the source lineDanilo M.1-1/+3
`set -a; . "$ENV_FILE"; set +a` on one line meant the `# shellcheck source=/dev/null` above it attached to the `set`, not the `.`, so SC1090 fired anyway. Split across lines, the directive binds and the script lints clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17fix: correct the .cod rationale, and stop world-reading the cacheDanilo M.1-3/+13
The comment claimed a bad key returns HTTP 200 with an error body, so the status code alone proves nothing. Measured against the live API, that is wrong: a bad key returns 401 and an unknown city 404, and with curl -f both fail at curl without the .cod check ever running. The claim came from the polybar script, which ran curl WITHOUT -f and so genuinely did receive error bodies with a success exit. The check was ported but not the reason for it. It still earns its place behind -f, for a 200 whose body is not usable weather, and the comment now says that instead of something false. The spec carried the same wrong sentence and is corrected too. Separately, the cache landed at 644 in a directory where every other generated file is 600, and the response carries the configured city and its coordinates. A umask before the write puts it at 600 without a window where it is briefly readable. The .cod discrepancy was found by the Task 6 implementer, which noticed the bad-key test produced a different message than the plan predicted and said so rather than reporting the expected text as achieved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17feat: add the weather fetch scriptDanilo M.1-0/+55
Fetches current weather from OpenWeatherMap into a cache file, meant to run from conky's ${execi 900 ...}. Writes to a temp file in the same directory as the target and renames atomically, so a killed or failed fetch never leaves the widget reading a half-written or error response. Distinguishes HTTP failure from a 200-with-error-body (a bad key returns the latter for some endpoints, the former here), and leaves any existing good cache untouched on either kind of failure. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>