From 70a2f8046c8acd8c9422f9c6b3f2ceeb4da91875 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 5 Jul 2013 19:01:10 -0400 Subject: [PATCH 1/2] 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); + }); }); }; From da4b761c45b1cba932dfc340818585207123a7ba Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 5 Jul 2013 19:17:12 -0400 Subject: [PATCH 2/2] Don't require `tmp` module unless we're going to use it. --- grunt/tasks/npm.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grunt/tasks/npm.js b/grunt/tasks/npm.js index 8fe6b7ad32..72d95e536b 100644 --- a/grunt/tasks/npm.js +++ b/grunt/tasks/npm.js @@ -2,7 +2,6 @@ var assert = require("assert"); var path = require("path"); -var tmp = require("tmp"); var grunt = require("grunt"); var spawn = grunt.util.spawn; @@ -48,7 +47,7 @@ module.exports = function() { grunt.log.writeln("Packing " + tgz + " (this could take a while)..."); run("npm", ["pack", "--verbose", "."], function() { - tmp.dir(function(err, dir) { + require("tmp").dir(function(err, dir) { if (err) { grunt.log.error(err); done(false);