@adinsure-ops/ops-cli 5.4.1-rc3 → 5.4.1-rc4
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/command.base.js +11 -7
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/lib/command.base.js
CHANGED
|
@@ -32,15 +32,19 @@ export default class CommandBase extends Command {
|
|
|
32
32
|
}
|
|
33
33
|
getYarnVersion() {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
// corepack writes an informational "about to download" notice to
|
|
36
|
-
// stderr when it needs to fetch a yarn version that isn't installed
|
|
37
|
-
// yet, even on success, so stderr content alone isn't a failure signal.
|
|
38
35
|
const output = yield this.childProcess.runCommand(['yarn', '--version']);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
if (output.error && !output.error.includes('Corepack is about to download')) {
|
|
37
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const version = output.data.split('\n')[0];
|
|
41
|
+
if (version) {
|
|
42
|
+
return version;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
ux.action.stop(`${chalk.red('failed getting yarn version')}`);
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
|
-
ux.action.stop(`${chalk.red(output.error || 'failed getting yarn version')}`);
|
|
44
48
|
throw new Error(`Could not resolve yarn version.`);
|
|
45
49
|
});
|
|
46
50
|
}
|
package/oclif.manifest.json
CHANGED