@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.
@@ -1,6 +1,6 @@
1
1
  export declare const packageEnv: {
2
2
  readonly fullName: "@gent-js/gent";
3
3
  readonly name: "gent";
4
- readonly version: "0.1.8";
4
+ readonly version: "0.1.9";
5
5
  readonly description: "template-based data generator.";
6
6
  };
@@ -2,6 +2,6 @@
2
2
  export const packageEnv = {
3
3
  fullName: "@gent-js/gent",
4
4
  name: "gent",
5
- version: "0.1.8",
5
+ version: "0.1.9",
6
6
  description: "template-based data generator."
7
7
  };
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
- async function main() {
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
- await program.parseAsync(process.argv);
102
+ program.parseAsync(process.argv).catch((error) => {
103
+ console.error(error);
104
+ });
101
105
  }
102
- await main();
106
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gent-js/gent",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "template-based data generator.",
5
5
  "keywords": [
6
6
  "gent"