codeplay-common 3.2.18 → 3.2.19
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.
|
@@ -217,13 +217,24 @@ function checkPackageVersion() {
|
|
|
217
217
|
const latestVersion = getLatestVersion(packageName);
|
|
218
218
|
|
|
219
219
|
if (!installedVersion) {
|
|
220
|
-
console.error(`${packageName} is not installed.
|
|
221
|
-
|
|
220
|
+
console.error(`${packageName} is not installed. Installing now...`);
|
|
221
|
+
execSync(`npm install ${packageName}`, { stdio: 'inherit' });
|
|
222
|
+
return;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
if (installedVersion !== latestVersion) {
|
|
225
|
-
console.
|
|
226
|
-
|
|
226
|
+
console.log(`${packageName} is outdated (installed: ${installedVersion}, latest: ${latestVersion}). Updating now...`);
|
|
227
|
+
|
|
228
|
+
try {
|
|
229
|
+
execSync(`npm uninstall ${packageName}`, { stdio: 'inherit' });
|
|
230
|
+
execSync(`npm install ${packageName}`, { stdio: 'inherit' });
|
|
231
|
+
console.log(`${packageName} successfully updated.`);
|
|
232
|
+
} catch (err) {
|
|
233
|
+
console.error(`Failed to update ${packageName}:`, err.message);
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return;
|
|
227
238
|
}
|
|
228
239
|
|
|
229
240
|
console.log(`${packageName} is up to date (version ${installedVersion}).`);
|