Browse Source

Merge branch 'master' of github.com:synrc/mad

Namdak Tonpa 7 years ago
parent
commit
f58d81818a
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/compile/mad_cubical.erl

+ 5 - 3
src/compile/mad_cubical.erl

@@ -3,7 +3,9 @@
 -compile(export_all).
 
 compile(File,Inc,Bin,Opt,Deps) ->
-    {_,_,Msg} = sh:run("cubical -b " ++ File),
-    case binary:match(Msg,[<<"successfully!">>]) of
+    {X,Res,Msg} = sh:run("cubical -b " ++ File),
+    case Res of
+         1 -> true;
+         0 -> case binary:match(Msg,[<<"successfully!">>]) of
                    nomatch -> io:format("Error: ~p~n",[Msg]), true;
-                   _ -> io:format("OK: ~p.~n",[filename:basename(File)]), false end.
+                   _ -> io:format("OK: ~p.~n",[filename:basename(File)]), false end end.