Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

feat: upgrade install.sh with full-featured bash installer#10

Merged
andersonleal merged 6 commits intomainfrom
feat/install-script-upgrade
Feb 12, 2026
Merged

feat: upgrade install.sh with full-featured bash installer#10
andersonleal merged 6 commits intomainfrom
feat/install-script-upgrade

Conversation

@andersonleal
Copy link
Copy Markdown
Contributor

Summary

Upgrades install.sh from a minimal POSIX shell script to a full-featured bash installer, matching the capabilities of the opencode installer pattern. The upgrade improves user experience, adds robust argument parsing, and provides better feedback during installation.

Key changes:

  • CLI argument parsing: -h/--help, -v/--version, -b/--binary, --no-modify-path
  • Advanced platform detection: Rosetta 2, musl/glibc, AVX2/baseline CPU variants
  • GitHub Releases API: Robust release fetching with jq or grep fallback for JSON parsing
  • GITHUB_TOKEN support: Authentication for private repos and rate limit mitigation
  • Download progress bar: curl trace-based progress display with unbuffered_sed and fd 4
  • Automatic PATH modification: bash, zsh, fish, ash, sh shells + GitHub Actions $GITHUB_PATH
  • Install from local binary: -b ./target/release/iii-console for development workflows
  • Version check: Skip download if requested version is already installed
  • Post-install branding: ASCII art with iii-console branding and usage instructions
  • Default install directory: ~/.local/bin (configurable via INSTALL_DIR)

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Other (please describe):

Checklist

  • I have read the project contributing guidelines
  • My code follows the code style of this project
  • I have added tests where applicable (N/A: shell script)
  • I have tested my changes locally
  • I have linked relevant issues
  • I have added screenshots for UI changes (if applicable)

Additional Context

Migration notes:

  • Switched from #!/usr/bin/env sh to #!/usr/bin/env bash for extended features
  • Uses set -euo pipefail for stricter error handling
  • BIN_DIR/PREFIX replaced by INSTALL_DIR (default $HOME/.local/bin)
  • Existing curl -fsSL ... | bash one-liners remain compatible; new options are additive

Compatibility:

  • Existing environment variables (REPO, BIN_NAME, TARGET, VERSION, GITHUB_TOKEN) continue to work
  • Specify version via -v 0.1.3 or VERSION=0.1.3

- Add rich progressive Slack notifications to release.yml with
  cross-job message updates via artifact-based slack_ts passing
- Add custom version bump option to create-tag.yml with format
  validation (X.Y.Z or X.Y.Z-suffix)
- Add publish-homebrew.yml workflow for Homebrew formula publishing
  to iii-hq/homebrew-tap (non-prerelease only)
- Integrate Slack progress updates into validate-release.yml using
  shared artifacts from the release workflow
- Add install.sh for installing iii-console from GitHub binary assets
  with OS/arch detection and optional version pinning
- Fix Homebrew formula heredoc indentation with sed strip (Critical)
- Add Linux SHA256 checksums to Homebrew formula (Critical)
- Fix expression injection in trigger-homebrew JS via env binding (High)
- Quote FORMULA_PATH and use env bindings for inputs.version (High)
- Add permissions: {} to notify-builds-complete job (Medium)
- Add continue-on-error to Slack update steps (Medium)
- Increase artifact retention to 3 days (Medium)
- Allow dotted pre-release in custom version regex (Medium)
- Use jq contains() instead of test() in install.sh (Low)
- Remove redundant pre-release check in publish-homebrew (Low)
Rewrite install script to match opencode installer capabilities:

- CLI argument parsing (-h/--help, -v/--version, -b/--binary, --no-modify-path)
- Advanced platform detection (Rosetta 2, musl/glibc, AVX2/baseline CPU)
- GitHub Releases API with jq/grep fallback for JSON parsing
- GITHUB_TOKEN authentication support for private repos
- curl trace-based download progress bar (unbuffered_sed + fd 4)
- Automatic PATH modification for bash/zsh/fish/ash/sh shells
- GitHub Actions $GITHUB_PATH integration
- ASCII art branding with post-install instructions
- POSIX sh compatible output (printf instead of echo -e)
- Default install directory: ~/.local/bin
- Update color definitions in install.sh to remove unnecessary comments, enhancing clarity and readability.
- Adjusted the output formatting in the post-install branding section to improve visual alignment.
- Added validation for REPO format to ensure it follows owner/repo structure.
- Implemented checks for BIN_NAME to restrict invalid characters.
- Enhanced INSTALL_DIR validation to prevent path injection attacks.
- Introduced version format validation for requested_version to ensure compliance with semver standards.
- Improved download and installation process with checksum verification and symlink rejection to enhance security.
- Updated extraction process to prevent path traversal vulnerabilities.
@andersonleal andersonleal merged commit 4dae296 into main Feb 12, 2026
@andersonleal andersonleal deleted the feat/install-script-upgrade branch February 12, 2026 23:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants