Ensure that the phantomjs binary has appropriate UNIX mode.

The 755 mode corresponds to a UNIX mode string of -rwxr-xr-x.

Closes #166.
This commit is contained in:
Ben Newman
2013-07-05 19:06:49 -04:00
parent 51bf95f6d1
commit 70a2f8046c
+9 -6
View File
@@ -1,6 +1,7 @@
'use strict';
var assert = require("assert");
var fs = require("fs");
var grunt = require("grunt");
var spawn = grunt.util.spawn;
var semver = require("semver");
@@ -58,11 +59,13 @@ module.exports = function() {
var config = this.data;
var done = this.async();
spawn({
cmd: phantomjs,
args: ["--version"]
}, function(error, result, code) {
checkVersion(error, result, code);
run(config, done);
fs.chmod(phantomjs, 755, function(err) {
spawn({
cmd: phantomjs,
args: ["--version"]
}, function(error, result, code) {
checkVersion(error, result, code);
run(config, done);
});
});
};