@misterhuydo/sentinel 1.4.14 → 1.4.15
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/upgrade.js +10 -0
- package/package.json +1 -1
package/lib/upgrade.js
CHANGED
|
@@ -62,6 +62,16 @@ module.exports = async function upgrade() {
|
|
|
62
62
|
process.exit(1);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// If a newer version was installed, re-exec so the rest of the upgrade runs with fresh code
|
|
66
|
+
const npmRootEarly = execSync('npm root -g', { encoding: 'utf8' }).trim();
|
|
67
|
+
const { version: installed } = require(path.join(npmRootEarly, '@misterhuydo', 'sentinel', 'package.json'));
|
|
68
|
+
if (installed !== current) {
|
|
69
|
+
ok(`Upgraded: ${current} → ${installed} — re-running with new version...`);
|
|
70
|
+
const newBin = path.join(path.dirname(npmRootEarly), 'bin', 'sentinel');
|
|
71
|
+
const r = spawnSync(newBin, ['upgrade'], { stdio: 'inherit' });
|
|
72
|
+
process.exit(r.status || 0);
|
|
73
|
+
}
|
|
74
|
+
|
|
65
75
|
info('Upgrading @misterhuydo/cairn-mcp...');
|
|
66
76
|
spawnSync('npm', ['install', '-g', '@misterhuydo/cairn-mcp@latest', '--prefer-online'], { stdio: 'inherit' });
|
|
67
77
|
ok('@misterhuydo/cairn-mcp upgraded');
|