@coresource/hz 0.1.1 → 0.1.3
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/hz.mjs +6 -3
- package/package.json +1 -1
package/dist/hz.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
|
-
import { readFileSync } from "fs";
|
|
5
|
-
import path7 from "path";
|
|
4
|
+
import { readFileSync, realpathSync } from "fs";
|
|
6
5
|
import { fileURLToPath } from "url";
|
|
7
6
|
import { Command, CommanderError as CommanderError3 } from "commander";
|
|
8
7
|
|
|
@@ -4718,7 +4717,7 @@ function isEntrypoint() {
|
|
|
4718
4717
|
if (!entryPath) {
|
|
4719
4718
|
return false;
|
|
4720
4719
|
}
|
|
4721
|
-
return
|
|
4720
|
+
return realpathSync(entryPath) === fileURLToPath(import.meta.url);
|
|
4722
4721
|
}
|
|
4723
4722
|
function writeError(stream, message) {
|
|
4724
4723
|
writeLine(stream, `Error: ${message}`);
|
|
@@ -4745,6 +4744,10 @@ function handleRunError(error, stderr) {
|
|
|
4745
4744
|
async function runCli(argv, dependencies = {}) {
|
|
4746
4745
|
const program = createProgram(dependencies);
|
|
4747
4746
|
program.exitOverride();
|
|
4747
|
+
if (argv.length === 0) {
|
|
4748
|
+
program.outputHelp();
|
|
4749
|
+
return 0;
|
|
4750
|
+
}
|
|
4748
4751
|
try {
|
|
4749
4752
|
await program.parseAsync(argv, { from: "user" });
|
|
4750
4753
|
return 0;
|