RobinBlomberg / kysely-codegen

Generate Kysely type definitions from your database.
MIT License
773 stars 69 forks source link

`--print` command line argument doesn't work #144

Closed glacius-mitchell closed 6 months ago

glacius-mitchell commented 6 months ago

Problem description

Invoking the CLI with --print doesn't actually print the generated output file to the terminal.

Identified cause

I believe the issue is that Cli.generate is not propagating options.print to the underlying await generator.generate({ ... }) call, meaning the generator is always receiving print: undefined regardless of what was specified on the command line:

https://github.com/RobinBlomberg/kysely-codegen/blob/be70e2556d9e80313b693288f9328a113458e290/src/cli/cli.ts#L82-L94

Proposed fix

Assuming that's the case, the fix should be as simple as adding print: options.print to the function call above.

Upvote & Fund

Fund with Polar

RobinBlomberg commented 6 months ago

Thanks for reporting! I fixed it now in 0.14.2!

glacius-mitchell commented 6 months ago

Thanks for the quick response! I just downloaded 0.14.2 and can confirm that --print now works as expected.