From cf108025e4ecb4d21175fa2d97a14ab3bfce015d Mon Sep 17 00:00:00 2001 From: Giancarlo Anemone Date: Fri, 21 Dec 2018 15:12:44 -0500 Subject: [PATCH] Add path option --- src/main/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index 2b9bf96..8b035bc 100755 --- a/src/main/index.js +++ b/src/main/index.js @@ -43,6 +43,9 @@ const argv = yargs describe: 'appended to generated type names', default: 'Type', }) + .option('path', { + describe: 'Path used for generated code', + }) .option('withsource', { describe: 'prepend the source path of the thrift file', default: false, @@ -72,7 +75,7 @@ for (const thriftPath of thriftPaths) { allOutput[converter.thriftPath] = converter.generateFlowFile(); } -const root = commonPathPrefix(Object.keys(allOutput)); +const root = argv.path || commonPathPrefix(Object.keys(allOutput)); for (const thriftPath in allOutput) { const relativeThriftPath = path.dirname(path.relative(root, thriftPath));