@gent-js/gent 0.1.8 → 0.1.9
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/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ const outOption = new Option("-o --out <path>", "path to output files.").default
|
|
|
14
14
|
const debugOption = new Option("-d --debug", "debug flat")
|
|
15
15
|
.default(false)
|
|
16
16
|
.hideHelp(true);
|
|
17
|
-
|
|
17
|
+
function main() {
|
|
18
18
|
const program = new Command();
|
|
19
19
|
program
|
|
20
20
|
.name(packageEnv.name)
|
|
@@ -41,7 +41,9 @@ async function main() {
|
|
|
41
41
|
if (meta !== undefined) {
|
|
42
42
|
const resolvedFilePath = parseAndResolveFilePath(meta, cwd);
|
|
43
43
|
if (resolvedFilePath === undefined) {
|
|
44
|
-
program.error(`failed to resolve meta file path.(${meta})
|
|
44
|
+
program.error(`failed to resolve meta file path.(${meta})`, {
|
|
45
|
+
exitCode: FAILED,
|
|
46
|
+
});
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
49
|
let fileContent;
|
|
@@ -52,7 +54,7 @@ async function main() {
|
|
|
52
54
|
console.log(error);
|
|
53
55
|
}
|
|
54
56
|
if (fileContent === undefined) {
|
|
55
|
-
program.error("failed to read meta file.");
|
|
57
|
+
program.error("failed to read meta file.", { exitCode: FAILED });
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
60
|
try {
|
|
@@ -63,7 +65,7 @@ async function main() {
|
|
|
63
65
|
rawProgramOptions = undefined;
|
|
64
66
|
}
|
|
65
67
|
if (rawProgramOptions === undefined) {
|
|
66
|
-
program.error("failed to parse meta file.");
|
|
68
|
+
program.error("failed to parse meta file.", { exitCode: FAILED });
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -97,6 +99,8 @@ async function main() {
|
|
|
97
99
|
program.error("Command has failed", { exitCode: resultCode });
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
|
-
|
|
102
|
+
program.parseAsync(process.argv).catch((error) => {
|
|
103
|
+
console.error(error);
|
|
104
|
+
});
|
|
101
105
|
}
|
|
102
|
-
|
|
106
|
+
main();
|