Skip to content

autoupdate 3/3: Apply pending update and re-exec#1769

Open
yahanxing-stripe wants to merge 1 commit into
yx/autoupdate-2-checkerfrom
yx/autoupdate-3-apply
Open

autoupdate 3/3: Apply pending update and re-exec#1769
yahanxing-stripe wants to merge 1 commit into
yx/autoupdate-2-checkerfrom
yx/autoupdate-3-apply

Conversation

@yahanxing-stripe

Copy link
Copy Markdown
Contributor

Summary

  • On startup, if a marker file exists, download the new binary, verify checksum, atomically replace the current binary, and re-exec the process
  • User sees:
    Automatically updating Stripe CLI from 1.23.0 to 1.23.1.
    To disable auto-update, set STRIPE_NO_AUTO_UPDATE=1 or add auto_update = false to ~/.config/stripe/config.toml
    Updated successfully ✓
    
  • If download or checksum fails: prints a one-line warning, clears marker, continues with current version
  • Binary is never left in a broken state (download to temp → atomic rename)
  • Supports both tar.gz (macOS/Linux) and zip (Windows) archives

This is part 3/3 of the auto-update feature for curl-installed binaries.
Stack: #1767 (config) → #1768 (checker) → this

Test plan

  • Manual test: build with an old version string, place in ~/.stripe/bin/, run a command, verify marker is written
  • Manual test: with marker present, run again — verify download + re-exec
  • Verify no-op for Homebrew-installed binary
  • Verify opt-out via env var and config.toml both skip the update

🤖 Generated with Claude Code

On startup, if a marker file indicates a newer version is available,
download the binary, verify its checksum, atomically replace the
current binary, and re-exec the process. The user always runs the
latest version with no manual step required.

This is part 3/3 of the auto-update feature for curl-installed binaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
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