joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
657 stars 87 forks source link

runner: Respect -o/--output-file when operating on directories, too #180

Closed gnprice closed 2 years ago

gnprice commented 2 years ago

This way, a command like:

$ flowgen some-lib/lib/types -o types/some-lib

will translate a file like:

some-lib/lib/types/foo/bar.d.ts

into a file:

types/some-lib/foo/bar.js.flow

Previously it would ignore the -o option in this case, and put everything under exports/ instead of the requested types/some-lib/, producing a file like:

exports/foo/bar.js.flow

which is less helpful.

If the user doesn't specify -o, then the behavior is unchanged.

orta commented 2 years ago

👍🏻 cool, yeah, makes sense to me - thanks