From 7efaacc5b11625d6441f32e3f01b0bab4c8d9206 Mon Sep 17 00:00:00 2001 From: kamal Date: Tue, 3 Jun 2025 15:04:48 -0400 Subject: [PATCH] support direct execution w/o the bin stub --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 71abcb9..b951b2c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -85,6 +85,11 @@ program // Export the program object for use in bin stub export { program }; +// Run the program if this file is executed directly +if (import.meta.url === `file://${process.argv[1]}`) { + program.parse(); +} + /** * Main function to run the generator */