Repository navigation
feat(install): unified install.sh that prefers Homebrew - #347
Conversation
Ships scripts/install.sh as a release asset. It installs through the hotdata-dev/tap/cli formula when brew is present (HOTDATA_NO_BREW=1 to skip), otherwise pipes to the cargo-dist installer. README now leads with the one-liner.
| if [ -n "$BREW" ]; then | ||
| echo "Homebrew found at $BREW; installing $FORMULA" >&2 | ||
| if "$BREW" list --formula cli >/dev/null 2>&1; then | ||
| "$BREW" upgrade "$FORMULA" |
There was a problem hiding this comment.
nit: Check the fully-qualified formula instead of the short name cli (not blocking).
| "$BREW" upgrade "$FORMULA" | |
| if "$BREW" list --formula "$FORMULA" >/dev/null 2>&1; then |
The short name cli matches any installed formula named cli from any tap. A user with a different cli formula takes the upgrade branch. brew upgrade hotdata-dev/tap/cli then fails with "not installed", and set -e aborts the script.
| echo "Homebrew not found; installing a prebuilt binary to ~/.hotdata/cli" >&2 | ||
| if command -v curl >/dev/null 2>&1; then | ||
| curl --proto '=https' --tlsv1.2 -LsSf "$DIST_INSTALLER" | sh | ||
| elif command -v wget >/dev/null 2>&1; then |
There was a problem hiding this comment.
nit: Download the dist installer fully before running it, so a failed download fails the script (not blocking).
POSIX sh has no pipefail. If curl fails here (404 before the next release, or a network error), sh reads empty input and exits 0. The script then reports success with no binary installed. CI jobs that use this installer pass silently. The wget branch on line 56 has the same problem.
Fix: capture the script first, for example script="$(curl --proto '=https' --tlsv1.2 -LsSf "$DIST_INSTALLER")" and then printf '%s\n' "$script" | sh. Under set -e, the failed assignment exits the script with an error.
Runs 'hotdata manage skills install --no-input' once the binary is in place, so ~/.claude/skills/hotdata exists right after install. Best-effort; HOTDATA_NO_SKILLS=1 skips it.
…r before running it
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Documents the unified installer from #347: Homebrew when present, prebuilt binary otherwise, skill installed afterward, and the two opt-out variables. Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
Adds
scripts/install.sh, published as a release asset via a dist extra-artifact, socurl .../releases/latest/download/install.sh | sh(and, after hotdata-dev/www#456,curl -fsSL https://hotdata.dev/install | sh) works on Linux and macOS.brewis found (PATH or the usual prefixes), runsbrew install hotdata-dev/tap/cli, orbrew upgradewhen already installed. This keeps the binary brew-managed sohotdata manage upgradefollows the same path.hotdata-cli-installer.sh(prebuilt binary in~/.hotdata/cli).hotdata manage skills install --no-inputso the agent skill is in~/.agents/skillsand linked into~/.claude/skillswhen that directory exists. Best-effort: a skill failure warns and does not fail the install.HOTDATA_NO_BREW=1forces the fallback;HOTDATA_NO_SKILLS=1skips the skill.Tested locally: fake-brew harness for the install branch, real brew for the already-installed branch (skill ends up symlinked into ~/.claude), shellcheck clean. The asset only exists from the next release onward.