rannn505 / child-shell

Node.js bindings 🔗 for shell
http://rannn505.github.io/child-shell/
MIT License
299 stars 71 forks source link

[Node-Bash] Command invocation failed #139

Open ahmad-invozone opened 3 years ago

ahmad-invozone commented 3 years ago

Executing simple command for disabling the GCLOUD CLI prompts command is getting executed fine but returning the response as command failed.

Package: Node-Bash (5.0.0-next.3) Error: Command invocation failed Environment:

Code:

  return shell.invoke
    .then((data: ShellCommandResult) => {
      const str = data.result;
      console.log('Output', str, data); // temporary for debugging purpose
      return str;
    })
    .catch(async (err: Error) => {
      console.log('InvokeError', err.message);
      if (err.message.includes('now logged in as')) return err.message; // hack for GCP login error
      return null;
    });

Screenshot: image