Fix install.sh version parsing with minified JSON - #62
Merged
Conversation
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: Combined Review (
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_latest_version()inscripts/install.shextracting the wrong JSON field when the GitHub API returns minified (single-line) JSONgrep | cutpipeline matched the entire JSON line and extracted the"url"value instead of"tag_name", producing a nonsensical download URLgrep -oto extract only the"tag_name":"..."substring before passing tocut, which works regardless of JSON formattingFixes #61
Test plan
curl -fsSL https://api.github.com/repos/wesm/agentsview/releases/latest | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | cut -d'"' -f4and verify it returns the tag (e.g.v0.8.0)curl -fsSL https://agentsview.io/install.sh | bashafter merge and verify successful install🤖 Generated with Claude Code