Skip to content

Fix install.sh version parsing with minified JSON - #62

Merged
wesm merged 2 commits into
mainfrom
install-sh-bugfix
Feb 27, 2026
Merged

Fix install.sh version parsing with minified JSON#62
wesm merged 2 commits into
mainfrom
install-sh-bugfix

Conversation

@wesm

@wesm wesm commented Feb 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix get_latest_version() in scripts/install.sh extracting the wrong JSON field when the GitHub API returns minified (single-line) JSON
  • The grep | cut pipeline matched the entire JSON line and extracted the "url" value instead of "tag_name", producing a nonsensical download URL
  • Use grep -o to extract only the "tag_name":"..." substring before passing to cut, which works regardless of JSON formatting

Fixes #61

Test plan

  • Run curl -fsSL https://api.github.com/repos/wesm/agentsview/releases/latest | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | cut -d'"' -f4 and verify it returns the tag (e.g. v0.8.0)
  • Pipe minified single-line JSON through the same pipeline and verify correct extraction
  • Run curl -fsSL https://agentsview.io/install.sh | bash after merge and verify successful install

🤖 Generated with Claude Code

wesm and others added 2 commits February 26, 2026 20:16
The grep/cut pipeline assumed "tag_name" would be on its own line in the
GitHub API response. When the response is minified (single line), grep
matched the entire JSON and cut extracted the "url" field value instead,
producing a download URL like agentsview_https://api.github.com/...

Use grep -o to extract only the "tag_name":"..." key-value pair before
passing to cut, which works regardless of JSON formatting.

Fixes #61

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers pretty-printed JSON, minified JSON (the #61 failure case),
field ordering, extra whitespace, pre-release tags, and missing
tag_name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Feb 27, 2026

Copy link
Copy Markdown

roborev: Combined Review (83495c1)

Summary Verdict: All reviewers agree the code is clean and free of medium, high, or critical severity issues.

No issues found.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

@wesm
wesm merged commit 06c3328 into main Feb 27, 2026
6 checks passed
cursor Bot pushed a commit to diazMelgarejo/periscope that referenced this pull request Jun 1, 2026
## Summary
- Fix `get_latest_version()` in `scripts/install.sh` extracting the
wrong JSON field when the GitHub API returns minified (single-line) JSON
- The `grep | cut` pipeline matched the entire JSON line and extracted
the `"url"` value instead of `"tag_name"`, producing a nonsensical
download URL
- Use `grep -o` to extract only the `"tag_name":"..."` substring before
passing to `cut`, which works regardless of JSON formatting

Fixes kenn-io#61

## Test plan
- [ ] Run `curl -fsSL
https://api.github.com/repos/wesm/agentsview/releases/latest | grep -o
'"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | cut -d'"' -f4`
and verify it returns the tag (e.g. `v0.8.0`)
- [ ] Pipe minified single-line JSON through the same pipeline and
verify correct extraction
- [ ] Run `curl -fsSL https://agentsview.io/install.sh | bash` after
merge and verify successful install

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@wesm
wesm deleted the install-sh-bugfix branch June 25, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

install script fails

1 participant