Vérification si le Bakefile existe
This commit is contained in:
@@ -16,6 +16,11 @@ public class BakefileParser {
|
|||||||
|
|
||||||
public List<Target> parse() {
|
public List<Target> parse() {
|
||||||
List<Target> targets = new ArrayList<>();
|
List<Target> targets = new ArrayList<>();
|
||||||
|
if (!Files.exists(Paths.get(filename))) {
|
||||||
|
System.out.println("*** No targets specified and no makefile found. Stop.");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<String> lines = Files.readAllLines(Paths.get(filename));
|
List<String> lines = Files.readAllLines(Paths.get(filename));
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
@@ -31,6 +36,6 @@ public class BakefileParser {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
BIN
tests/test-02-existe-deja/main
Executable file
BIN
tests/test-02-existe-deja/main
Executable file
Binary file not shown.
Reference in New Issue
Block a user