Skip to content

feat(cli): add update command for self-updating the binary#194

Open
calebdw wants to merge 1 commit into
PHPantom-dev:mainfrom
calebdw:calebdw/push-lnrmuulyqlpx
Open

feat(cli): add update command for self-updating the binary#194
calebdw wants to merge 1 commit into
PHPantom-dev:mainfrom
calebdw:calebdw/push-lnrmuulyqlpx

Conversation

@calebdw

@calebdw calebdw commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Adds a new phpantom_lsp update subcommand that downloads the latest release from GitHub and replaces the current binary.

Features:

  • --check: dry run, exits 0 if up-to-date, 1 if update available
  • --no-confirm: skip confirmation prompt (for CI/scripts)
  • Semver-aware version comparison (ignores git-describe suffixes)
  • Platform auto-detection for all 6 supported targets
  • .tar.gz extraction (Unix) and .zip extraction (Windows)
  • Atomic binary replacement via self-replace crate

New dependencies: ureq (HTTP), tar, flate2, zip (archives), self-replace (binary swap).

Closes #107

@codecov-commenter

codecov-commenter commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 212 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/self_update.rs 0.00% 212 Missing ⚠️

📢 Thoughts on this report? Let us know!

@calebdw calebdw force-pushed the calebdw/push-lnrmuulyqlpx branch from a20a061 to 92ff8ce Compare July 4, 2026 03:40
Adds a new `phpantom_lsp update` subcommand that downloads the latest
release from GitHub and replaces the current binary.

Features:
  - `--check`: dry run, exits 0 if up-to-date, 1 if update available
  - `--no-confirm`: skip confirmation prompt (for CI/scripts)
  - Semver-aware version comparison (ignores git-describe suffixes)
  - Platform auto-detection for all 6 supported targets
  - `.tar.gz` extraction (Unix) and `.zip` extraction (Windows)
  - Atomic binary replacement via `self-replace` crate

New dependencies: ureq (HTTP), tar, flate2, zip (archives),
self-replace (binary swap).

Closes PHPantom-dev#107
@calebdw calebdw force-pushed the calebdw/push-lnrmuulyqlpx branch from 92ff8ce to c5c8c2f Compare July 4, 2026 04:07
@AJenbo

AJenbo commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Going online is scary, we should couple it with this #177

@calebdw

calebdw commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Hmm, doesn't look like I have the permissions to make that change so it will have to be done when you're ready. Not sure that there's any blockers to it though

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.

Add self-update command for updating the binary

3 participants