Skip to content

feat: installation & distribution overhaul#83

Open
brian-lai wants to merge 11 commits into
mainfrom
para/installation-distribution
Open

feat: installation & distribution overhaul#83
brian-lai wants to merge 11 commits into
mainfrom
para/installation-distribution

Conversation

@brian-lai
Copy link
Copy Markdown
Owner

Summary

  • Install method marker — every installer writes ~/.config/codetect/install_method (git/brew/binary) so codetect update knows how to update itself
  • Version staleness checkcheck_for_updates() in the wrapper hits the GitHub releases API once per 24 hours (3s timeout, silent on failure) and prints a one-line notice to stderr when a newer version is available; skipped for the mcp command
  • codetect update overhaul — detects install method and dispatches to the right updater: brew upgrade codetect, go install ...@latest, install-binary.sh, or the existing git-clone update.sh; falls back gracefully with new install instructions when method is unknown
  • scripts/install-binary.sh — new curl one-liner installer with OS/arch detection, GitHub Releases download, SHA256 checksum verification, PATH setup, and marker file write
  • Formula/codetect.rb — Homebrew formula with post_install marker write (canonical version lives in a separate homebrew-tap repo; SHA256 placeholder needs updating on each release)
  • packaging/deb/ — Debian control file, postinst marker script, and build-deb.sh for producing .deb release artifacts
  • README — Quick Start replaced with four install methods (Homebrew, curl, .deb, from source); Requirements table updated (Go demoted to build-from-source only)

Notes

  • The Homebrew formula sha256 is a placeholder — update it with the real tarball SHA256 when cutting a release
  • The curl and .deb install paths depend on pre-built binaries being attached to GitHub Releases; a goreleaser workflow (future work) would automate this
  • cmd_version() now reads ~/.local/share/codetect/VERSION as a fallback for brew/binary installs where no git repo is present

Test plan

  • Run install.sh and verify ~/.config/codetect/install_method contains git
  • Run codetect version and codetect index — confirm one-line update notice appears after clearing last_update_check; confirm it is suppressed on repeat runs within 24h
  • Simulate each install_method value and verify codetect update dispatches to the correct handler
  • Verify codetect update with no marker file and no GOPATH match falls back to update.sh with the new error message
  • Verify README renders correctly on GitHub

🤖 Generated with Claude Code

- check_for_updates: write timestamp only after successful API response
- check_for_updates: suppress nag for dev builds (version looks like '(abc1234)')
- install-binary.sh: gate read prompt behind [[ -t 0 ]] to fix curl|bash pipe
- install-binary.sh: prefer re-download over cp "$0" for pipe installs
- packaging/deb/postinst: resolve actual user home via SUDO_USER for dpkg root runs
- Makefile: use git describe --abbrev=0 to avoid dirty suffix in VERSION file
- Formula/codetect.rb: wrap post_install in rescue so write failure is non-fatal
- cmd_update go branch: clarify only codetect-mcp is updated via go install
- postinst: don't use XDG_CONFIG_HOME under sudo (belongs to root not SUDO_USER)
- build-deb.sh: add --abbrev=0 fallback to VERSION detection (consistent with Makefile)
- check_for_updates: replace (( )) arithmetic with [[ $(( )) -ge ]] to avoid set -e exit on zero
- install-binary.sh: document that non-interactive curl|bash defaults to adding PATH
- Formula/codetect.rb: add TODO comment on sha256 placeholder line
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