codify-plugin-lib 1.0.3 → 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.
- package/dist/utils/utils.js +7 -2
- package/package.json +2 -2
- package/src/utils/utils.ts +11 -7
package/dist/utils/utils.js
CHANGED
|
@@ -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
|
-
|
|
10
|
-
|
|
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.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"ajv": "^8.12.0",
|
|
15
15
|
"ajv-formats": "^2.1.1",
|
|
16
|
-
"codify-schemas": "1.0.
|
|
16
|
+
"codify-schemas": "1.0.3",
|
|
17
17
|
"@npmcli/promise-spawn": "^7.0.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
package/src/utils/utils.ts
CHANGED
|
@@ -19,13 +19,17 @@ export async function codifySpawn(
|
|
|
19
19
|
opts?: CodifySpawnOptions,
|
|
20
20
|
extras?: Record<any, any>,
|
|
21
21
|
): Promise<SpawnResult> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 {
|