Skip to content

Require output file to be passed in and default to console output #24

@rickyp-uber

Description

@rickyp-uber

Right now thrift2flow creates a directory and outputs the file there. This makes scripting a bit harder since you can't take the contents of the output and perform operations on it. Some examples:

  1. What if I want to output it to a different location? Right now I have to run thrift2flow, copy the file and then delete the folder created by the tool.
  2. Testing currently depends on the file system since it's actually outputting files as the tests run.

Instead I suggest when you run

thrift2flow something.thrift

That the contents of the generated file gets outputted to the console and when you run

thrift2flow something.thrift --o[[ut]put] ../something.types.js

The output will be written to the file path provided

An extension of this would be the ability to pass globby style strings and output globby style outputs. For example

// Filesystem
./thrifts/group1/subgroup1/product1.thrift
./thrifts/group1/subgroup2/product1.thrift
./thrifts/group1/subgroup2/product2.thrift

// CLI
thrift2flow ./thrifts/**/*.thrift --o[[ut]put] ./types/**/*.types.js

But this could be handled as a separate issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions