npx / bunx storebound always run the newest version: a copy started from the npx or bunx cache re-runs the command as storebound@<newest> when npm has a newer one (registry asked at most every 10 minutes, 1.5 s timeout; off with STOREBOUND_NO_UPDATE=1, in CI and offline); a project install gets a one-line note instead

This commit is contained in:
CRTkafa 2026-10-18 13:07:45 +07:00
parent 3381673ae6
commit 14ffe3545a
3 changed files with 86 additions and 0 deletions

View file

@ -61,6 +61,8 @@ async function main(): Promise<void> {
argv.splice(i, argv[i]!.includes('=') ? 1 : 2);
}
}
// npx / bunx run a cached copy: start the newest storebound instead (cli/lib/self-update.ts)
{ const { runNewest } = await import('./lib/self-update'); await runNewest((await import('../package.json')).version, process.argv.slice(2)); }
const [a, b] = argv;
if (!a || a === 'help' || a === '--help' || a === '-h') return help();
if (a === 'version' || a === '--version') return console.log((await import('../package.json')).version);