fix(install): install the latest release, not whatever is on main - #83
Merged
Conversation
public/install.sh hardcoded MOSHCODE_REF=main, so every `curl … | sh` and every `install.sh update` shipped whatever happened to be sitting on the branch, and cutting a release changed nothing about what users received. Publishing v0.13.2 and re-running the installer logged `moshcoder/moshcode@main` — the tag was never consulted. MOSHCODE_REF now defaults to empty and resolves at install time to the latest published release tag, falling back to main when the API is rate-limited, blocked, or the repo has no release yet. An explicit MOSHCODE_REF still pins any tag or branch, so `MOSHCODE_REF=main` remains the way to track the branch on purpose. Resolution moved into install_cli so the network call happens after the curl/tar/node check rather than at script load. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
moshcoding.com/install.sh(this repo'spublic/install.sh— byte-identical to what the site serves) hardcoded:MOSHCODE_REF="${MOSHCODE_REF:-main}"So every
curl … | shand everyinstall.sh updateinstalled whatever was sitting onmain, and cutting a release changed nothing about what users got. Caught it right after publishingv0.13.2: the installer loggedfetching moshcode (moshcoder/moshcode@main). The tag was never consulted.Two consequences: users receive unreleased merges, and a release tag is decorative.
The fix
MOSHCODE_REFdefaults to empty and resolves at install time viaresolve_ref():MOSHCODE_REFwins — pins any tag or branch (MOSHCODE_REF=mainstill tracks the branch deliberately)mainwhen the API is rate-limited, blocked, or the repo has no release yet — a flaky API must not fail the install|| truekeepsset -efrom aborting on a failed curl or a non-matching grep. Resolution moved insideinstall_cliso the network call happens after the curl/tar/node check, not at script load.Verification
resolve_refin isolation:v0.13.2MOSHCODE_REF=mainmainMOSHCODE_REF=v0.12.3v0.12.3mainmainset -e0End-to-end, real script into a sandbox
MOSHCODE_HOME:Was
@mainbefore this change.sh -nclean.🤖 Generated with Claude Code