@nu-art/commando 0.204.36 → 0.204.38

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/cli/nvm.js CHANGED
@@ -129,14 +129,13 @@ class Cli_NVM extends ts_common_1.Logger {
129
129
  return cli_1.CommandoInteractive.create(...plugins).debug()
130
130
  .append('export NVM_DIR="$HOME/.nvm"')
131
131
  .append('[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm')
132
- .append('[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion')
133
132
  .append('nvm use');
134
133
  }
135
134
  createCommando(...plugins) {
136
135
  return cli_1.Commando.create(...plugins)
137
136
  .append('export NVM_DIR="$HOME/.nvm"')
138
137
  .append('[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm')
139
- .append('[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion');
138
+ .append('nvm use');
140
139
  }
141
140
  }
142
141
  exports.Cli_NVM = Cli_NVM;
package/cli/pnpm.js CHANGED
@@ -21,7 +21,7 @@ class Cli_PNPM extends ts_common_1.Logger {
21
21
  }
22
22
  this.logDebug(`installing PNPM version ${this._expectedVersion}`);
23
23
  await (commando !== null && commando !== void 0 ? commando : cli_1.Commando.create())
24
- .append(`curl -fsSL "https://get.pnpm.io/install.sh" | env PNPM_VERSION=${this._expectedVersion} sh -`)
24
+ .append(`curl -fsSL "https://get.pnpm.io/install.sh" | env PNPM_VERSION=${this._expectedVersion} bash -`)
25
25
  .execute();
26
26
  return this;
27
27
  };
package/core/cli.d.ts CHANGED
@@ -19,6 +19,7 @@ type Options = {
19
19
  indentation: number;
20
20
  };
21
21
  export declare class BaseCLI extends Logger {
22
+ protected stderrValidator: ((stdout: string) => boolean);
22
23
  protected stdoutProcessors: ((stdout: string) => void)[];
23
24
  protected stderrProcessors: ((stdout: string) => void)[];
24
25
  protected commands: string[];
package/core/cli.js CHANGED
@@ -20,6 +20,7 @@ class BaseCLI extends ts_common_1.Logger {
20
20
  */
21
21
  constructor(options = defaultOptions) {
22
22
  super();
23
+ this.stderrValidator = () => true;
23
24
  this.stdoutProcessors = [];
24
25
  this.stderrProcessors = [];
25
26
  this.commands = [];
@@ -113,8 +114,10 @@ class CliInteractive extends BaseCLI {
113
114
  if (!message.length)
114
115
  return;
115
116
  try {
116
- this.stdoutProcessors.forEach(processor => processor(message));
117
- this.stderrProcessors.forEach(processor => processor(message));
117
+ if (!this.stderrValidator(message))
118
+ this.stdoutProcessors.forEach(processor => processor(message));
119
+ else
120
+ this.stderrProcessors.forEach(processor => processor(message));
118
121
  this.logInfo(`${message}`);
119
122
  }
120
123
  catch (e) {
@@ -150,7 +153,11 @@ class Cli extends BaseCLI {
150
153
  if (error) {
151
154
  reject(new CliError_1.CliError(`executing:\n${command}\n`, stdout, stderr, error));
152
155
  }
153
- if (stderr)
156
+ const errorLogs = stderr.split('\n');
157
+ const { filteredIn, filteredOut } = (0, ts_common_1.filterInOut)(errorLogs, this.stderrValidator);
158
+ stderr = filteredIn.join('\n').trim();
159
+ stdout += `from stderr: \n${filteredOut.join('\n')}`;
160
+ if (stderr && stderr.length > 0)
154
161
  reject(stderr);
155
162
  if (stdout) {
156
163
  this.stdoutProcessors.forEach(processor => processor(stdout));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/commando",
3
- "version": "0.204.36",
3
+ "version": "0.204.38",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "TacB0sS",