@sap-ux/nodejs-utils 0.0.3 → 0.1.1
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/commandRunner.d.ts +3 -1
- package/dist/commandRunner.js +3 -2
- package/package.json +2 -2
package/dist/commandRunner.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SpawnOptionsWithoutStdio } from 'child_process';
|
|
1
2
|
/**
|
|
2
3
|
*
|
|
3
4
|
*/
|
|
@@ -7,9 +8,10 @@ export declare class CommandRunner {
|
|
|
7
8
|
*
|
|
8
9
|
* @param {string} cmd to execute
|
|
9
10
|
* @param {string[]} args to pass to the command
|
|
11
|
+
* @param {SpawnOptionsWithoutStdio} [opts] options to pass to the command
|
|
10
12
|
* @returns {*} {(Promise<any | void>)}
|
|
11
13
|
* @memberof CommandRunner
|
|
12
14
|
*/
|
|
13
|
-
run(cmd: string, args?: string[]): Promise<string | void>;
|
|
15
|
+
run(cmd: string, args?: string[], opts?: SpawnOptionsWithoutStdio): Promise<string | void>;
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=commandRunner.d.ts.map
|
package/dist/commandRunner.js
CHANGED
|
@@ -11,13 +11,14 @@ class CommandRunner {
|
|
|
11
11
|
*
|
|
12
12
|
* @param {string} cmd to execute
|
|
13
13
|
* @param {string[]} args to pass to the command
|
|
14
|
+
* @param {SpawnOptionsWithoutStdio} [opts] options to pass to the command
|
|
14
15
|
* @returns {*} {(Promise<any | void>)}
|
|
15
16
|
* @memberof CommandRunner
|
|
16
17
|
*/
|
|
17
|
-
run(cmd, args = []) {
|
|
18
|
+
run(cmd, args = [], opts = {}) {
|
|
18
19
|
return new Promise((resolve, reject) => {
|
|
19
20
|
const stack = [];
|
|
20
|
-
const spawnOpts = process.platform === 'win32' ? { shell: true } :
|
|
21
|
+
const spawnOpts = process.platform === 'win32' ? { ...opts, shell: true } : opts;
|
|
21
22
|
const spawnedCmd = (0, child_process_1.spawn)(cmd, args, spawnOpts);
|
|
22
23
|
spawnedCmd.stdout.setEncoding('utf8');
|
|
23
24
|
let response;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/nodejs-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Nodejs utility wrappers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"fast-glob": "3.3.1",
|
|
18
18
|
"read-pkg-up": "7.0.1",
|
|
19
19
|
"semver": "7.5.4",
|
|
20
|
-
"@sap-ux/btp-utils": "0.
|
|
20
|
+
"@sap-ux/btp-utils": "0.16.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/semver": "7.5.2",
|