@@ -18,20 +18,29 @@ public static void main(String[] args) {
1818 // In eclipse only needed this:"../liquidjava-example/src/main/java/"
1919 // In VSCode needs:
2020 // "../liquidjava/liquidjava-umbrella/liquidjava-example/src/main/java/liquidjava/test/project";
21- String file = args .length == 0 ? allPath : args [0 ];
22- ErrorEmitter ee = launch (file );
21+ String path = args .length == 0 ? allPath : args [0 ];
22+ ErrorEmitter ee = launch (path );
2323 System .out .println (ee .foundError () ? (ee .getFullMessage ()) : ("Correct! Passed Verification." ));
2424 }
2525
26- public static ErrorEmitter launchTest (String file ) {
27- ErrorEmitter ee = launch (file );
26+ public static ErrorEmitter launchTest (String path ) {
27+ ErrorEmitter ee = launch (path );
2828 return ee ;
2929 }
3030
31- public static ErrorEmitter launch (String file ) {
32- System .out .println ("Running LiquidJava on: " + file );
31+ public static ErrorEmitter launch (String path ) {
32+ System .out .println ("Running LiquidJava on: " + path );
33+ ErrorEmitter ee = new ErrorEmitter ();
34+
35+ // check if the path exists
36+ File f = new File (path );
37+ if (!f .exists ()) {
38+ ee .addError ("Path not found" , "The path " + path + " does not exist" , 1 );
39+ return ee ;
40+ }
41+
3342 Launcher launcher = new Launcher ();
34- launcher .addInputResource (file );
43+ launcher .addInputResource (path );
3544 launcher .getEnvironment ().setNoClasspath (true );
3645
3746 // Get the current classpath from the system
@@ -48,7 +57,6 @@ public static ErrorEmitter launch(String file) {
4857 final Factory factory = launcher .getFactory ();
4958 final ProcessingManager processingManager = new QueueProcessingManager (factory );
5059
51- ErrorEmitter ee = new ErrorEmitter ();
5260 final RefinementProcessor processor = new RefinementProcessor (factory , ee );
5361 processingManager .addProcessor (processor );
5462
0 commit comments