We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f8ce1a commit cc01fbfCopy full SHA for cc01fbf
1 file changed
src/cli.ts
@@ -189,7 +189,8 @@ async function runGenerate(args: CliArgs): Promise<void> {
189
}
190
191
// Only run when executed directly (not when imported by tests)
192
-const isMain = process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1]);
193
-if (isMain) {
+const thisFile = fs.realpathSync(fileURLToPath(import.meta.url));
+const entryFile = process.argv[1] ? fs.realpathSync(path.resolve(process.argv[1])) : '';
194
+if (thisFile === entryFile) {
195
createProgram().parseAsync();
196
0 commit comments