mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 12:23:22 +00:00
writeJSONError now returns a jsonSilentError sentinel that main() recognises — it exits with code 1 without printing plain-text output to stdout. This fixes a regression where --json errors (config load failure, missing source dir, discovery failure) returned exit 0. All writeJSONError call sites changed from the broken pattern: writeJSONError(err); return nil // exit 0, wrong to: return writeJSONError(err) // exit 1, correct Also applied the same fix to update.go error paths which had the older pattern of writeJSONError(err) followed by return err (which would print both JSON and plain text). Added regression tests for sync and install error paths verifying both non-zero exit code and valid JSON error output on stdout.