Skip to content

Add one-line curl install/uninstall scripts - #43

Merged
madeye merged 1 commit into
mainfrom
feat/curl-installer
Jul 9, 2026
Merged

Add one-line curl install/uninstall scripts#43
madeye merged 1 commit into
mainfrom
feat/curl-installer

Conversation

@madeye

@madeye madeye commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Adds curl … | bash install and uninstall entry points, and documents the one-liners in the README and the docs guide.

# install (latest release for your platform + root helper)
curl -fsSL https://raw.githubusercontent.com/madeye/LianYaoHu/main/scripts/install.sh | bash
# uninstall
curl -fsSL https://raw.githubusercontent.com/madeye/LianYaoHu/main/scripts/uninstall.sh | bash

scripts/install.sh — detects the platform (maps to aarch64-apple-darwin / x86_64-unknown-linux-gnu; clear build-from-source error otherwise), resolves the latest tag via the GitHub releases/latest redirect (no jq/gh needed), downloads the tarball + .sha256, verifies it (sha256sum or shasum), installs lianyaohu + lyh into /usr/local/bin (sudo only when the target isn't writable), and runs the packaged install-helper.sh with LIANYAOHU_HELPER_BINARY set so it uses the downloaded binary instead of building. Flags: --version, --bin-dir, --no-helper; env overrides LIANYAOHU_VERSION / LIANYAOHU_BIN_DIR / LIANYAOHU_NO_HELPER / LIANYAOHU_REPO.

scripts/uninstall.sh — tears down the root helper by fetching the canonical uninstall-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.sh off its predictable /tmp/lianyaohu-group.$$ path to mktemp + trap, matching the install-helper.sh hardening from #39.

Testing

  • bash -n on all three scripts.
  • End-to-end install into a temp --bin-dir with --no-helper against the real v0.1.3 release: latest-tag resolution, download, checksum verification, extraction, and both binaries installed and runnable.
  • Uninstall binary-removal path (--keep-helper) into the same temp dir.

Note: the main-pinned raw URLs resolve only after this merges. The helper-teardown fetch in uninstall.sh likewise needs this on main (or LIANYAOHU_REF).

🤖 Generated with Claude Code

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>
@madeye
madeye merged commit bccb266 into main Jul 9, 2026
2 checks passed
@madeye
madeye deleted the feat/curl-installer branch July 9, 2026 06:07
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