Skip to content

Commit

Permalink
bug: output dot file in same folder as input
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuh022 committed Sep 29, 2024
1 parent 91dd90a commit 8317262
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/scheduler/parsers/CLIParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ private static void parseOptionalArguments(Arguments arguments, CommandLine comm
*/
private static void setDefaultOutputDOTFilePath(Arguments arguments) {
String inputDOTFilePath = arguments.getInputDOTFilePath();
// String outputDirectory = "src/main/resources/dotfiles/output/";
String outputDirectory = inputDOTFilePath;
String inputFileName = new File(inputDOTFilePath).getName();
String outputFileName = inputFileName.replace(".dot", "-output.dot");
File inputFile = new File(inputDOTFilePath);
String outputFileName = inputFile.getName().replace(".dot", "-output.dot");
String outputDOTFilePath = inputFile.getParent() + File.separator + outputFileName;
if (inputFile.getParent() == null) {
outputDOTFilePath = outputFileName;
}

arguments.setOutputDOTFilePath(outputDirectory.concat(outputFileName));
arguments.setOutputDOTFilePath(outputDOTFilePath);
}

/**
Expand Down

0 comments on commit 8317262

Please sign in to comment.