Skip to content

Add downloadRossoctl install script#10

Open
esnible wants to merge 1 commit into
mainfrom
download-script
Open

Add downloadRossoctl install script#10
esnible wants to merge 1 commit into
mainfrom
download-script

Conversation

@esnible

@esnible esnible commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

Adds downloadRossoctl at the repo root — a POSIX-sh installer meant to be piped into sh:

curl -fsSL https://raw.githubusercontent.com/kagenti/rossoctl-cli/main/downloadRossoctl | sh

It detects the platform via uname / uname -m, downloads the matching rossoctl-<version>-<os>-<arch>.tar.gz release archive, extracts it into a temp dir, and installs the binary at $HOME/.rossoctl/rossoctl (chmod +x), then prints a PATH hint.

Behavior

  • Version: installs the latest release by default (resolved via the /releases/latest redirect); pin with ROSSOCTL_CLI_VERSION=v0.1.0.
  • Arch normalization: aarch64arm64, amd64x86_64, to match the release asset labels (Linux uname -m reports aarch64, but assets are labeled arm64).
  • Install location: $HOME/.rossoctl/rossoctl; the script prints how to add $HOME/.rossoctl to PATH (it does not edit rc files).

Pipe-to-sh best practices

  • set -eu; all logic wrapped in main() invoked on the last line, so a truncated download can't execute a partial script.
  • curl-or-wget fallback; mktemp temp dir with a cleanup trap.
  • Clear errors for unsupported OS/arch, failed download, missing binary in the archive, and the "only prereleases exist → set ROSSOCTL_CLI_VERSION" case.

Verification

  • shellcheck -s sh and sh -n both clean.
  • Installed the real v0.1.0-alpha.1 release end-to-end (rossoctl versionv0.1.0-alpha.1); also tested a local mock server, arch/OS normalization, and the error paths (unsupported arch/OS, 404 download, latest-with-only-prereleases).
  • Executable bit (100755) tracked in git.

README updated with the one-liner.

🤖 Generated with Claude Code

Add a POSIX-sh installer meant to be piped into sh:

  curl -fsSL .../downloadRossoctl | sh

It detects the platform via `uname` / `uname -m` (normalizing aarch64 ->
arm64 to match the release asset labels), downloads the matching
rossoctl-<version>-<os>-<arch>.tar.gz release archive, extracts it into a
temp dir (cleaned up on exit), and installs the binary at
$HOME/.rossoctl/rossoctl with chmod +x, then prints a PATH hint.

Version defaults to the latest release (resolved via the /releases/latest
redirect) and can be pinned with ROSSOCTL_CLI_VERSION. Follows pipe-to-sh
best practices: set -eu, all logic wrapped in main() invoked on the last
line (partial downloads don't execute), curl/wget fallback, and clear
errors for unsupported OS/arch and failed downloads. README documents it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Ed Snible <snible@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant