Fix jq parse error in get-arctl download script#262
Merged
Conversation
Fixes #45 — The `get-arctl` install script fails with `jq: parse error: Invalid numeric literal at line 1, column 9` during the installed version check. ### Root cause `checkArctlInstalledVersion()` pipes `arctl version` output to `jq -r '.arctl_version'`, expecting JSON. But `arctl version` outputs plain text: ``` arctl version v0.1.1 Git commit: abc123 Build date: 2026-01-15 ``` # Change Type ``` /kind fix ``` # Changelog ```release-note NONE ``` ### Changes 1. **Line 129**: Parse version from text output using `awk '{print $NF}'` instead of `jq` 2. **Line 115**: Suppress jq stderr (`2>/dev/null`) so GitHub API errors produce a clean failure message instead of a confusing jq parse error ### Testing - Verified `arctl version` output format matches the awk extraction pattern - The existing flow (version comparison, download, install) is unchanged Closes #143 Authored-By: Joel Klabo <[email protected]>
timflannagan
approved these changes
Mar 9, 2026
Collaborator
timflannagan
left a comment
There was a problem hiding this comment.
LGTM for fixing the actual bug fix. I think this code is a bit hard to read and lacks tests, so a potential cleanup candidate in the medium term.
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.
Description
Fixes #45 — The
get-arctlinstall script fails withjq: parse error: Invalid numeric literal at line 1, column 9during the installed version check.checkArctlInstalledVersion()pipesarctl versionoutput tojq -r '.arctl_version', expecting JSON. Butarctl versionoutputs plain text:Change Type
Changelog
Changes
awk '{print $NF}'instead ofjq2>/dev/null) so GitHub API errors produce a clean failure message instead of a confusing jq parse errorTesting
arctl versionoutput format matches the awk extraction patternCloses #143
Co-authored-by: Joel Klabo [email protected]