Commit dc4dbf15 dc4dbf150c0afbd8a650270e87d3813ef5452653 by Nicolas Perriault

Merge pull request #758 from hexid/dotNET-exit-code

Update dotNET executable to return the exit code of the casper instance
2 parents abb7f55a 8613e4d5
No preview for this file type
...@@ -97,7 +97,7 @@ class slimerjs : engine { ...@@ -97,7 +97,7 @@ class slimerjs : engine {
97 } 97 }
98 98
99 class casperjs { 99 class casperjs {
100 static void Main(string[] args) { 100 static int Main(string[] args) {
101 var SUPPORTED_ENGINES = new Dictionary<string, engine> { 101 var SUPPORTED_ENGINES = new Dictionary<string, engine> {
102 {"phantomjs", new phantomjs()}, 102 {"phantomjs", new phantomjs()},
103 {"slimerjs", new slimerjs()} 103 {"slimerjs", new slimerjs()}
...@@ -167,9 +167,10 @@ class casperjs { ...@@ -167,9 +167,10 @@ class casperjs {
167 string line = p.StandardOutput.ReadLine(); 167 string line = p.StandardOutput.ReadLine();
168 Console.WriteLine(line); 168 Console.WriteLine(line);
169 } 169 }
170 return p.ExitCode;
170 } catch(Win32Exception e) { 171 } catch(Win32Exception e) {
171 Console.WriteLine("Fatal: " + e.Message + "; did you install " + ENGINE + "?"); 172 Console.WriteLine("Fatal: " + e.Message + "; did you install " + ENGINE + "?");
172 Environment.Exit(1); 173 return -1;
173 } 174 }
174 } 175 }
175 } 176 }
......