codify-plugin-lib 1.0.4 → 1.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.
@@ -6,8 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.isDebug = exports.codifySpawn = void 0;
7
7
  const promise_spawn_1 = __importDefault(require("@npmcli/promise-spawn"));
8
8
  async function codifySpawn(cmd, args, opts, extras) {
9
- const stdio = isDebug() ? 'inherit' : 'pipe';
10
- return (0, promise_spawn_1.default)(cmd, args, { ...opts, stdio, stdioString: true }, extras);
9
+ try {
10
+ const stdio = isDebug() ? 'inherit' : 'pipe';
11
+ return await (0, promise_spawn_1.default)(cmd, args, { ...opts, stdio, stdioString: true }, extras);
12
+ }
13
+ catch (e) {
14
+ return e;
15
+ }
11
16
  }
12
17
  exports.codifySpawn = codifySpawn;
13
18
  function isDebug() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -19,13 +19,17 @@ export async function codifySpawn(
19
19
  opts?: CodifySpawnOptions,
20
20
  extras?: Record<any, any>,
21
21
  ): Promise<SpawnResult> {
22
- const stdio = isDebug() ? 'inherit' : 'pipe';
23
- return promiseSpawn(
24
- cmd,
25
- args,
26
- { ...opts, stdio, stdioString: true },
27
- extras
28
- );
22
+ try {
23
+ const stdio = isDebug() ? 'inherit' : 'pipe';
24
+ return await promiseSpawn(
25
+ cmd,
26
+ args,
27
+ { ...opts, stdio, stdioString: true },
28
+ extras
29
+ );
30
+ } catch (e) {
31
+ return e as any;
32
+ }
29
33
  }
30
34
 
31
35
  export function isDebug(): boolean {