@goldstack/utils-cli 0.2.7 → 0.2.10
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/src/utilsCli.d.ts +3 -3
- package/dist/src/utilsCli.js +29 -29
- package/package.json +4 -3
package/dist/src/utilsCli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare type AsyncFunction<O> = () => Promise<O>;
|
|
2
|
-
export declare const wrapCli: (func: AsyncFunction<any>) => Promise<void>;
|
|
3
|
-
export {};
|
|
1
|
+
declare type AsyncFunction<O> = () => Promise<O>;
|
|
2
|
+
export declare const wrapCli: (func: AsyncFunction<any>) => Promise<void>;
|
|
3
|
+
export {};
|
|
4
4
|
//# sourceMappingURL=utilsCli.d.ts.map
|
package/dist/src/utilsCli.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wrapCli = void 0;
|
|
4
|
-
const isDebug = process.env.GOLDSTACK_DEBUG || process.env.DEBUG;
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
-
const wrapCli = async (func) => {
|
|
7
|
-
try {
|
|
8
|
-
await func();
|
|
9
|
-
process.exit(0);
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
if (isDebug) {
|
|
13
|
-
throw e;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
console.log('❌ ' + e.message);
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.wrapCli = wrapCli;
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
process.on('unhandledRejection', (e) => {
|
|
24
|
-
if (isDebug) {
|
|
25
|
-
console.log(e);
|
|
26
|
-
}
|
|
27
|
-
console.log('❌ Unhandled error in asynchronous method:', e.message);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapCli = void 0;
|
|
4
|
+
const isDebug = process.env.GOLDSTACK_DEBUG || process.env.DEBUG;
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
const wrapCli = async (func) => {
|
|
7
|
+
try {
|
|
8
|
+
await func();
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
if (isDebug) {
|
|
13
|
+
throw e;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
console.log('❌ ' + e.message);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.wrapCli = wrapCli;
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
process.on('unhandledRejection', (e) => {
|
|
24
|
+
if (isDebug) {
|
|
25
|
+
console.log(e);
|
|
26
|
+
}
|
|
27
|
+
console.log('❌ Unhandled error in asynchronous method:', e.message);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
30
|
//# sourceMappingURL=utilsCli.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/utils-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Utilities for building command line interfaces.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "yarn clean && yarn compile",
|
|
25
25
|
"build:watch": "yarn clean && yarn compile-watch",
|
|
26
|
-
"clean": "
|
|
26
|
+
"clean": "rimraf ./dist",
|
|
27
27
|
"compile": "tsc -p tsconfig.json",
|
|
28
28
|
"compile-watch": "tsc -p tsconfig.json --watch",
|
|
29
29
|
"compile-watch:light": "nodemon --watch ./src/ -e '*' --exec 'yarn compile'",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@goldstack/utils-git": "0.1.
|
|
38
|
+
"@goldstack/utils-git": "0.1.31",
|
|
39
39
|
"@types/jest": "^27.0.2",
|
|
40
40
|
"@types/node": "^16.11.0",
|
|
41
41
|
"jest": "^26.6.3",
|
|
42
|
+
"rimraf": "^3.0.2",
|
|
42
43
|
"ts-jest": "^26.5.4",
|
|
43
44
|
"typescript": "^4.4.3"
|
|
44
45
|
},
|