Skip to content

Commit a33442c

Browse files
committed
check that input file exists
1 parent 236e66c commit a33442c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/org/variantsync/diffdetective/validation/Validation.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.variantsync.diffdetective.util.Assert;
2222

2323
import java.io.IOException;
24+
import java.nio.file.Files;
2425
import java.nio.file.Path;
2526
import java.nio.file.Paths;
2627
import java.util.List;
@@ -131,10 +132,14 @@ public static void main(String[] args) throws IOException {
131132
if (args.length < 1) {
132133
datasetsFile = DefaultDatasets.DEFAULT_DATASETS_FILE;
133134
} else if (args.length > 1) {
134-
System.err.println("Error: Expected exactly one argument but got " + args.length + "! Expected a path to a datasets markdown file.");
135+
Logger.error("Error: Expected exactly one argument but got " + args.length + "! Expected a path to a datasets markdown file.");
135136
return;
136137
} else {
137138
datasetsFile = Path.of(args[0]);
139+
140+
if (!Files.exists(datasetsFile)) {
141+
Logger.error("The given datasets file \"" + datasetsFile + "\" does not exist.");
142+
}
138143
}
139144

140145
final ParseOptions.DiffStoragePolicy diffStoragePolicy = ParseOptions.DiffStoragePolicy.DO_NOT_REMEMBER;

0 commit comments

Comments
 (0)