Skip to content

Commit 7f85986

Browse files
fix: skip auto-upgrade when running 'sf migrate'
The legacy auto-upgrade and 'sf migrate' both target ~/.local/bin/sf, so running them back-to-back risks clobbering the freshly installed Rust binary. Set SF_CLI_DISABLE_AUTO_UPGRADE=1 before dispatching 'sf migrate' so the upgrade path is skipped entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a358e64 commit 7f85986

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ import { registerZones } from "./lib/zones.tsx";
3434
async function main() {
3535
const program = new Command();
3636

37+
// `sf migrate` replaces this binary outright, so auto-upgrading the legacy
38+
// CLI first would be wasted work — and worse, the install scripts target
39+
// the same `~/.local/bin/sf` path, so racing them risks clobbering the new
40+
// Rust binary the user is about to install.
41+
if (process.argv[2] === "migrate") {
42+
process.env.SF_CLI_DISABLE_AUTO_UPGRADE = "1";
43+
}
44+
3745
if (!process.argv.includes("--json")) {
3846
const [shownUpgradeBanner] = await Promise.all([
3947
checkVersion(),

0 commit comments

Comments
 (0)