phantom.exit() compatibility with phantomjs 1.7-dev
Showing
1 changed file
with
11 additions
and
9 deletions
... | @@ -276,16 +276,18 @@ if (!phantom || phantom.version.major !== 1 || phantom.version.minor < 5) { | ... | @@ -276,16 +276,18 @@ if (!phantom || phantom.version.major !== 1 || phantom.version.minor < 5) { |
276 | phantom.casperScript = phantom.casperArgs.get(0); | 276 | phantom.casperScript = phantom.casperArgs.get(0); |
277 | } | 277 | } |
278 | 278 | ||
279 | if (!fs.isFile(phantom.casperScript)) { | 279 | if (phantom.casperScript) { |
280 | console.error('Unable to open file: ' + phantom.casperScript); | 280 | if (!fs.isFile(phantom.casperScript)) { |
281 | phantom.exit(1); | 281 | console.error('Unable to open file: ' + phantom.casperScript); |
282 | } | 282 | phantom.exit(1); |
283 | 283 | } else { | |
284 | // filter out the called script name from casper args | 284 | // filter out the called script name from casper args |
285 | phantom.casperArgs.drop(phantom.casperScript); | 285 | phantom.casperArgs.drop(phantom.casperScript); |
286 | 286 | ||
287 | // passed casperjs script execution | 287 | // passed casperjs script execution |
288 | phantom.injectJs(phantom.casperScript); | 288 | phantom.injectJs(phantom.casperScript); |
289 | } | ||
290 | } | ||
289 | }; | 291 | }; |
290 | 292 | ||
291 | if (!phantom.casperLoaded) { | 293 | if (!phantom.casperLoaded) { | ... | ... |
-
Please register or sign in to post a comment