Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rickyp-uber opened this issue Sep 13, 2018 · 1 comment
Open

Comments

@rickyp-uber
Copy link
Collaborator

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

@rickyp-uber rickyp-uber changed the title Require output file to be passed in Require output file to be passed in and default to console output Sep 13, 2018
@rickyp-uber
Copy link
Collaborator Author

Note that this change is a breaking change and we should focus it around the v1.0 launch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant