Skip to content

Commit

Permalink
Fixes #97 - Add generateWorkflow to WorkflowGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem committed Apr 27, 2024
1 parent 776dacf commit dc84e6d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/com/manorrock/parrot/workflow/WorkflowGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
package com.manorrock.parrot.workflow;

import com.manorrock.parakeet.YAMLWriter;
import com.manorrock.parrot.ParrotContext;
import com.manorrock.parrot.ParrotGenerator;
import com.manorrock.parrot.model.Workflow;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;

/**
* The GitHub workflow generator.
Expand Down Expand Up @@ -72,6 +72,16 @@ private String generateRelativeFilename(File file) {
return file.getAbsolutePath()
.substring(baseDirectory.getAbsolutePath().length() + 1);
}

/**
* Generate a workflow.
*
* @param context the context.
* @return the workflow.
*/
private Workflow generateWorkflow(ParrotContext context) {
return new Workflow();
}

/**
* Process the given file.
Expand All @@ -80,7 +90,7 @@ private String generateRelativeFilename(File file) {
*/
private void processFile(File file) {
try {
Workflow workflow = new Workflow();
Workflow workflow = generateWorkflow(new ParrotContext());
File outputFile = new File(outputDirectory, generateOutputFilename(file));
YAMLWriter writer = new YAMLWriter(new FileWriter(outputFile));
writer.writeObject(workflow);
Expand Down

0 comments on commit dc84e6d

Please sign in to comment.