Skip to content

Commit

Permalink
feat(ui): only write pseudocode to file
Browse files Browse the repository at this point in the history
  • Loading branch information
TREX1-JR committed Oct 19, 2024
1 parent bd76946 commit 1de2be8
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 197 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ USAGE
$ sf ftc generate code -f <value> [--json] [--flags-dir <value>] [-d <value>]
FLAGS
-d, --output=<value> The output directory for the pseudocode.
-d, --output=<value> The output directory for the pseudocode. If not provided, the pseudocode will be written to the
same directory as the flow file.
-f, --file=<value> (required) The flow file to convert to pseudocode.
GLOBAL FLAGS
Expand Down
2 changes: 1 addition & 1 deletion messages/ftc.generate.code.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The flow file to convert to pseudocode.

# flags.output.summary

The output directory for the pseudocode.
The output directory for the pseudocode. If not provided, the pseudocode will be written to the same directory as the flow file.

# examples

Expand Down
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/commands/ftc/generate/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default class FtcGenerateCode extends SfCommand<FtcGenerateCodeResult> {
const parser: xml2js.Parser = new xml2js.Parser({ explicitArray: false });
const flow: Flow = ((await parser.parseStringPromise(fileContent)) as ParsedXml).Flow;
const parseTree: string = new FlowParser().toPseudoCode(flow);
this.log(parseTree);
const outputPath: string = FtcGenerateCode.getOutputPath(filepath, flags.output);
await fs.writeFile(outputPath, parseTree, 'utf-8');
this.log(`Output written to ${outputPath}`);
Expand Down
Loading

0 comments on commit 1de2be8

Please sign in to comment.