Skip to content

Commit

Permalink
fix: move logic in generator
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jan 10, 2024
1 parent e406dee commit c96601c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,11 @@ public void processOpts() {

testsGenerators.add(new TestsRequest(language, client));
testsGenerators.add(new TestsClient(language, client));
testsGenerators.add(new SnippetsGenerator(language, client));

for (TestsGenerator testGen : testsGenerators) {
testGen.addSupportingFiles(supportingFiles, outputFolder, extension);
}

SnippetsGenerator snippetGenerator = new SnippetsGenerator(language, client);

if (!snippetGenerator.available()) {
return;
}

String snippetsExtension = Helpers.getClientConfigField(language, "snippets", "extension");
String snippetsOutputFolder = Helpers.getClientConfigField(language, "snippets", "outputFolder");

snippetGenerator.addSupportingFiles(supportingFiles, snippetsOutputFolder, snippetsExtension);

testsGenerators.add(snippetGenerator);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public void addSupportingFiles(List<SupportingFile> supportingFiles, String outp
return;
}

extension = Helpers.getClientConfigField(language, "snippets", "extension");
outputFolder = Helpers.getClientConfigField(language, "snippets", "outputFolder");

if (!outputFolder.equals("")) {
outputFolder = "/" + outputFolder + "/";
} else {
Expand Down

0 comments on commit c96601c

Please sign in to comment.