Skip to content

Commit

Permalink
Add output when csv write was successful (#173)
Browse files Browse the repository at this point in the history
* add output when csv write was successful

* let the logger do the work
  • Loading branch information
ingorichtsmeier authored Jan 26, 2023
1 parent 95823c4 commit fe947d3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ private void writeResults(
}
}
if (csv) {
try (FileWriter fw =
new FileWriter(
determineFileName(new File(targetDirectory(), "conversion-results.csv")))) {
File csvFile = determineFileName(new File(targetDirectory(), "conversion-results.csv"));
try (FileWriter fw = new FileWriter(csvFile)) {
converter.writeCsvFile(results, fw);
LOG_CLI.info("Created {}", csvFile);
} catch (IOException e) {
LOG_CLI.error("Error while creating csv results: {}", createMessage(e));
returnCode = 1;
Expand Down Expand Up @@ -151,8 +151,7 @@ private File determineFileName(File file) {
newFile =
new File(
file.getParentFile(),
prefix
+ FilenameUtils.getBaseName(file.getName())
FilenameUtils.getBaseName(file.getName())
+ " ("
+ counter
+ ")."
Expand Down

0 comments on commit fe947d3

Please sign in to comment.