@voke-sh/voke 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/chunk-GPGK6AMR.js +11636 -0
- package/dist/cli/index.js +28 -0
- package/dist/index.d.ts +727 -0
- package/dist/index.js +64 -0
- package/package.json +41 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
UsageError,
|
|
4
|
+
VokeError,
|
|
5
|
+
buildProgram
|
|
6
|
+
} from "../chunk-GPGK6AMR.js";
|
|
7
|
+
|
|
8
|
+
// src/cli/index.ts
|
|
9
|
+
var main = async () => {
|
|
10
|
+
const dashIdx = process.argv.indexOf("--");
|
|
11
|
+
const stdioArgs = dashIdx !== -1 ? process.argv.slice(dashIdx + 1) : void 0;
|
|
12
|
+
const cleanArgv = dashIdx !== -1 ? process.argv.slice(0, dashIdx) : process.argv;
|
|
13
|
+
await buildProgram(stdioArgs).parseAsync(cleanArgv);
|
|
14
|
+
};
|
|
15
|
+
main().catch((err) => {
|
|
16
|
+
let code;
|
|
17
|
+
if (err instanceof VokeError) {
|
|
18
|
+
code = err.exitCode;
|
|
19
|
+
} else if (err instanceof UsageError) {
|
|
20
|
+
code = 3;
|
|
21
|
+
} else {
|
|
22
|
+
code = 70;
|
|
23
|
+
}
|
|
24
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
25
|
+
process.stderr.write(`${message}
|
|
26
|
+
`);
|
|
27
|
+
process.exit(code);
|
|
28
|
+
});
|