Skip to content

Commit

Permalink
Fix CLI execution check and update exports in index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbraksa committed Oct 11, 2024
1 parent 65cbcb2 commit f97dce1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ function runCLI () {
program.parse()
}

// Run the CLI if this file is being executed directly
if (import.meta.url === import.meta.resolve(process.argv[1])) {
if (import.meta.url === `file://${process.argv[1]}`) {
runCLI()
}

// Export the runCLI function for use in other files if needed
export { program, runCLI }
export { runCLI }

0 comments on commit f97dce1

Please sign in to comment.