@sap-ux/nodejs-utils 0.0.2 → 0.1.0
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
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/dist/installedCheck.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findInstalledPackages =
|
|
6
|
+
exports.findInstalledPackages = findInstalledPackages;
|
|
7
7
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
8
8
|
const commandRunner_1 = require("./commandRunner");
|
|
9
9
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
@@ -70,7 +70,6 @@ async function findInstalledPackages(subName, options) {
|
|
|
70
70
|
}
|
|
71
71
|
return installedGenPackageInfos;
|
|
72
72
|
}
|
|
73
|
-
exports.findInstalledPackages = findInstalledPackages;
|
|
74
73
|
/**
|
|
75
74
|
* Returns all possible node modules install paths. On BAS this can be various locations.
|
|
76
75
|
* On VSCode this can be a custom location. NPM global root is always included.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/nodejs-utils",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Nodejs utility wrappers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/semver": "7.5.2",
|
|
24
24
|
"@types/vscode": "1.73.1",
|
|
25
25
|
"mock-spawn": "0.2.6",
|
|
26
|
-
"typescript": "5.
|
|
26
|
+
"typescript": "5.6.2"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|