@fredlackey/devutils 0.0.5 → 0.0.7
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
CHANGED
|
@@ -566,7 +566,8 @@ async function install_windows() {
|
|
|
566
566
|
console.log('Installing Google Chrome via winget...');
|
|
567
567
|
|
|
568
568
|
const result = await winget.install(WINGET_PACKAGE_ID, {
|
|
569
|
-
silent: true
|
|
569
|
+
silent: true,
|
|
570
|
+
source: 'winget'
|
|
570
571
|
});
|
|
571
572
|
|
|
572
573
|
if (result.success) {
|
|
@@ -577,8 +578,20 @@ async function install_windows() {
|
|
|
577
578
|
return;
|
|
578
579
|
}
|
|
579
580
|
|
|
580
|
-
// winget failed
|
|
581
|
-
|
|
581
|
+
// winget failed - check if it's a "already installed" scenario
|
|
582
|
+
// winget returns non-zero even when the app is already installed
|
|
583
|
+
if (result.output && result.output.includes('already installed')) {
|
|
584
|
+
console.log('Google Chrome is already installed.');
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// winget failed, log the error and try Chocolatey as fallback
|
|
589
|
+
console.log('winget installation failed:');
|
|
590
|
+
if (result.output) {
|
|
591
|
+
console.log(result.output);
|
|
592
|
+
}
|
|
593
|
+
console.log('');
|
|
594
|
+
console.log('Trying Chocolatey as fallback...');
|
|
582
595
|
}
|
|
583
596
|
|
|
584
597
|
// Try Chocolatey if available
|