@graphai/shell_utilty_agent 0.0.4 → 0.0.5

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.
@@ -40,7 +40,7 @@ const runShellCommand = (command, path) => {
40
40
  return new Promise((resolve, reject) => {
41
41
  (0, child_process_1.exec)(command, { cwd: path ?? process.cwd() }, function (error, stdout, stderr) {
42
42
  if (error) {
43
- reject(error);
43
+ reject({ error, stderr, stdout });
44
44
  }
45
45
  else if (stdout) {
46
46
  resolve({ text: stdout, stderr });
@@ -63,13 +63,14 @@ const runShellAgent = async ({ namedInputs, }) => {
63
63
  const result = await (0, exports.runShellCommand)(command, dir);
64
64
  return result;
65
65
  }
66
- catch (error) {
67
- if (error instanceof Error) {
66
+ catch (err) {
67
+ if (err instanceof Error) {
68
68
  return {
69
- error: error.message,
69
+ error: err.message,
70
70
  };
71
71
  }
72
- return { error };
72
+ const { error, stderr, stdout } = err;
73
+ return { error, stderr, stdout };
73
74
  }
74
75
  };
75
76
  exports.runShellAgent = runShellAgent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphai/shell_utilty_agent",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "shell utilty agent",
5
5
  "main": "lib/index.js",
6
6
  "files": [