speccrew 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/update.js +5 -10
- package/package.json +1 -1
package/lib/commands/update.js
CHANGED
|
@@ -377,25 +377,20 @@ function run() {
|
|
|
377
377
|
try {
|
|
378
378
|
const args = parseArgs();
|
|
379
379
|
|
|
380
|
-
// Self-update
|
|
380
|
+
// Self-update check: notify user if a newer CLI version is available
|
|
381
381
|
const localVersion = getPackageVersion();
|
|
382
382
|
let latestVersion = null;
|
|
383
383
|
try {
|
|
384
384
|
const { execSync } = require('child_process');
|
|
385
385
|
latestVersion = execSync('npm view speccrew version', { encoding: 'utf8', timeout: 15000 }).trim();
|
|
386
386
|
} catch (e) {
|
|
387
|
-
// Network error or npm not available, skip
|
|
387
|
+
// Network error or npm not available, skip version check
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
if (latestVersion && latestVersion !== localVersion) {
|
|
391
|
-
console.log(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
execSync('npm install -g speccrew@latest', { stdio: 'inherit', timeout: 60000 });
|
|
395
|
-
console.log(`CLI updated to v${latestVersion}\n`);
|
|
396
|
-
} catch (e) {
|
|
397
|
-
console.warn(`Warning: CLI self-update failed (${e.message}). Continuing with current version.\n`);
|
|
398
|
-
}
|
|
391
|
+
console.log(`\n New CLI version available: v${localVersion} → v${latestVersion}`);
|
|
392
|
+
console.log(` Run "npm install -g speccrew@latest" to upgrade, then re-run "speccrew update"\n`);
|
|
393
|
+
process.exit(0);
|
|
399
394
|
}
|
|
400
395
|
|
|
401
396
|
const projectRoot = process.cwd();
|