Skip to content

Commit f2dc37b

Browse files
committed
feat: log removed files
1 parent f1f89cd commit f2dc37b

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/main/java/one/edee/babylon/export/Exporter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public void walkPathsAndCheckDB(TranslationConfiguration configuration) {
7070
result.getPathsOfNewMsgFiles().forEach(log::info);
7171
}
7272

73+
if (!result.getObsoleteFilePaths().isEmpty()){
74+
log.info("PATHS REMOVED:");
75+
result.getObsoleteFilePaths().forEach(log::info);
76+
}
77+
7378
boolean hasAnySheetChanges = result.getSheets().stream().filter(i -> i.getDataRowCount() > 0).count() > 1;
7479
if (hasAnySheetChanges){
7580
log.info("");
@@ -80,7 +85,7 @@ public void walkPathsAndCheckDB(TranslationConfiguration configuration) {
8085
}
8186
}
8287

83-
if (result.getPathsOfNewMsgFiles().isEmpty() && !hasAnySheetChanges)
88+
if (result.getPathsOfNewMsgFiles().isEmpty() && !hasAnySheetChanges && result.getObsoleteFilePaths().isEmpty())
8489
log.info("No changes detected.");
8590
log.info("");
8691
log.info("𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂𐄂");

src/main/java/one/edee/babylon/export/TranslationCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public ExportResult walkPathsAndCollectTranslationSheets(Collection<String> allP
5454
.collect(Collectors.toList());
5555
snapshotWriteContract.removeMsgFilePaths(obsoleteFilePaths);
5656

57-
return new ExportResult(newMsgFilesPaths, sheets);
57+
return new ExportResult(newMsgFilesPaths, sheets, obsoleteFilePaths);
5858
}
5959

6060
/** Collects only {@link TranslationSheet}s from {@link MessageFileExportResult} - for lack of tuples and unzip function */

src/main/java/one/edee/babylon/export/dto/ExportResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ public class ExportResult {
1111

1212
private final List<TranslationSheet> sheets;
1313

14+
private final List<String> obsoleteFilePaths;
15+
1416
}

0 commit comments

Comments
 (0)