Add one-line curl install/uninstall scripts - #43
Merged
Conversation
scripts/install.sh downloads the latest release for the host platform (aarch64-apple-darwin or x86_64-unknown-linux-gnu), verifies its SHA-256, installs the lianyaohu/lyh binaries into /usr/local/bin (sudo only when the target is not writable), and installs the root helper via the packaged install-helper.sh. Supports --version, --bin-dir, and --no-helper, and errors with a build-from-source hint on unsupported platforms. scripts/uninstall.sh tears down the root helper by fetching the canonical uninstall-helper.sh (single source of truth) and removes the binaries; --keep-helper and --bin-dir supported. README and the docs guide gain the copy-paste one-liners. Also switch uninstall-helper.sh off its predictable /tmp group-discovery path to mktemp, matching install-helper.sh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Adds
curl … | bashinstall and uninstall entry points, and documents the one-liners in the README and the docs guide.scripts/install.sh— detects the platform (maps toaarch64-apple-darwin/x86_64-unknown-linux-gnu; clear build-from-source error otherwise), resolves the latest tag via the GitHubreleases/latestredirect (nojq/ghneeded), downloads the tarball +.sha256, verifies it (sha256sumorshasum), installslianyaohu+lyhinto/usr/local/bin(sudo only when the target isn't writable), and runs the packagedinstall-helper.shwithLIANYAOHU_HELPER_BINARYset so it uses the downloaded binary instead of building. Flags:--version,--bin-dir,--no-helper; env overridesLIANYAOHU_VERSION/LIANYAOHU_BIN_DIR/LIANYAOHU_NO_HELPER/LIANYAOHU_REPO.scripts/uninstall.sh— tears down the root helper by fetching the canonicaluninstall-helper.sh(keeps a single source of truth for the LaunchDaemon/systemd/group removal) and removes the binaries. Flags:--keep-helper,--bin-dir.Also switches
uninstall-helper.shoff its predictable/tmp/lianyaohu-group.$$path tomktemp+trap, matching theinstall-helper.shhardening from #39.Testing
bash -non all three scripts.--bin-dirwith--no-helperagainst the real v0.1.3 release: latest-tag resolution, download, checksum verification, extraction, and both binaries installed and runnable.--keep-helper) into the same temp dir.🤖 Generated with Claude Code