openkbs 0.0.49 → 0.0.50
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/package.json +1 -1
- package/src/actions.js +13 -4
- package/version.json +2 -2
package/package.json
CHANGED
package/src/actions.js
CHANGED
|
@@ -651,10 +651,19 @@ async function updateCliAction() {
|
|
|
651
651
|
if (compareVersions(currentVersion, remoteVersion) < 0) {
|
|
652
652
|
cliUpdateAvailable = true;
|
|
653
653
|
console.log(`New CLI version available: ${remoteVersion}`);
|
|
654
|
-
console.
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
654
|
+
console.log('Updating automatically...');
|
|
655
|
+
|
|
656
|
+
// Spawn npm update as detached child process
|
|
657
|
+
const { spawn } = require('child_process');
|
|
658
|
+
const updateProcess = spawn('npm', ['update', '-g', 'openkbs'], {
|
|
659
|
+
detached: true,
|
|
660
|
+
stdio: 'inherit'
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
updateProcess.unref(); // Allow parent to exit
|
|
664
|
+
|
|
665
|
+
console.green(`Update started! OpenKBS CLI will be updated to version ${remoteVersion}.`);
|
|
666
|
+
console.log('The update will complete in the background.');
|
|
658
667
|
} else {
|
|
659
668
|
console.green('OpenKBS CLI is already up to date.');
|
|
660
669
|
}
|
package/version.json
CHANGED