From 70a2f8046c8acd8c9422f9c6b3f2ceeb4da91875 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 5 Jul 2013 19:01:10 -0400 Subject: [PATCH] Ensure that the phantomjs binary has appropriate UNIX mode. The 755 mode corresponds to a UNIX mode string of -rwxr-xr-x. Closes #166. --- grunt/tasks/phantom.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/grunt/tasks/phantom.js b/grunt/tasks/phantom.js index d5c66eb258..740ea27aaa 100644 --- a/grunt/tasks/phantom.js +++ b/grunt/tasks/phantom.js @@ -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); + }); }); };