We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25ba36f commit 4d5c9caCopy full SHA for 4d5c9ca
1 file changed
src/cli/index.ts
@@ -1,12 +1,15 @@
1
#!/usr/bin/env node
2
3
import { argv } from 'node:process';
4
+import { fileURLToPath } from 'node:url';
5
import { program } from 'commander';
6
import { version } from '../../package.json';
7
import { envOptions } from './env';
8
import type { CliOptions } from './types';
9
-async function cli() {
10
+export type { CliOptions };
11
+
12
+export async function cli() {
13
const options = program
14
.name('starter-node')
15
.option('--foo <foo>', 'Foo.', envOptions.foo)
@@ -30,4 +33,6 @@ async function cli() {
30
33
console.log(options);
31
34
}
32
35
-cli();
36
+if (argv[1] === fileURLToPath(import.meta.url)) {
37
+ cli();
38
+}
0 commit comments