Skip to content

Fix jq parse error in get-arctl download script#262

Merged
peterj merged 1 commit intomainfrom
fix/version-json-and-install-script
Mar 9, 2026
Merged

Fix jq parse error in get-arctl download script#262
peterj merged 1 commit intomainfrom
fix/version-json-and-install-script

Conversation

@peterj
Copy link
Copy Markdown
Contributor

@peterj peterj commented Mar 5, 2026

Description

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.

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

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

Co-authored-by: Joel Klabo [email protected]

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]>
Copilot AI review requested due to automatic review settings March 5, 2026 18:03
@peterj peterj changed the title # Description Fix jq parse error in get-arctl download script Mar 5, 2026
@peterj peterj closed this Mar 5, 2026
@peterj peterj reopened this Mar 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Collaborator

@timflannagan timflannagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@peterj peterj added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit 884328e Mar 9, 2026
13 of 17 checks passed
@peterj peterj deleted the fix/version-json-and-install-script branch March 9, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting a jq error in the download script

3 participants