]> source.dussan.org Git - vaadin-framework.git/commitdiff
SassCompiler finds input in a better way, fixes #10299 97/297/1
authorMarc Englund <marc@vaadin.com>
Tue, 20 Nov 2012 08:42:54 +0000 (10:42 +0200)
committerMarc Englund <marc@vaadin.com>
Tue, 20 Nov 2012 08:42:54 +0000 (10:42 +0200)
Change-Id: I56c6a45008e072313f7be6f700f25df228287271

theme-compiler/src/com/vaadin/sass/SassCompiler.java

index e6ac31b865477938fe8208a8b353614c69979d50..07d6eb01f16a6cebd99ebc40e70bf04b6b73eddf 100644 (file)
@@ -25,14 +25,20 @@ public class SassCompiler {
     public static void main(String[] args) throws Exception {
         String input = null;
         String output = null;
-        if (args.length == 0) {
+        if (args.length < 1 || args.length > 2) {
             System.out
                     .println("usage: SassCompile <scss file to compile> <css file to write>");
             return;
-        } else if (args.length == 1) {
-            input = args[0];
-        } else {
-            input = args[0];
+        }
+
+        File in = new File(args[0]);
+        if (!in.canRead()) {
+            System.err.println(in.getCanonicalPath() + " could not be read!");
+            return;
+        }
+        input = in.getCanonicalPath();
+
+        if (args.length == 2) {
             output = args[1];
         }