toga-ai 1.0.22 → 1.0.23
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/scripts/install.js +6 -12
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -510,22 +510,16 @@ function main() {
|
|
|
510
510
|
|
|
511
511
|
const bundleVersion = getBundleVersion();
|
|
512
512
|
|
|
513
|
-
//
|
|
514
|
-
// Skip during --post-install
|
|
513
|
+
// Auto-upgrade if npx served a stale cached version (common on Windows).
|
|
514
|
+
// Skip during --post-install — npm already ensured the right version.
|
|
515
515
|
if (!isPostInstall) {
|
|
516
516
|
const latestVersion = getLatestNpmVersion();
|
|
517
517
|
if (latestVersion && semverLt(bundleVersion, latestVersion)) {
|
|
518
518
|
console.log('');
|
|
519
|
-
console.log('
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
console.log('');
|
|
524
|
-
console.log(' npm cache clean --force');
|
|
525
|
-
console.log(' npx toga-ai@latest');
|
|
526
|
-
console.log('');
|
|
527
|
-
console.log(' (This is a common npx caching issue on Windows.)');
|
|
528
|
-
process.exit(1);
|
|
519
|
+
console.log(' Stale version detected (toga-ai@' + bundleVersion + ' → toga-ai@' + latestVersion + '). Auto-upgrading...');
|
|
520
|
+
const upgradeArgs = ['toga-ai@' + latestVersion, '--yes'].concat(args);
|
|
521
|
+
const upgrade = spawnSync('npx', upgradeArgs, { stdio: 'inherit', shell: process.platform === 'win32' });
|
|
522
|
+
process.exit(upgrade.status ?? 0);
|
|
529
523
|
}
|
|
530
524
|
}
|
|
531
525
|
|