From 784697414d4ef4215f7b92e72afe00bd578d34f1 Mon Sep 17 00:00:00 2001 From: John Haley Date: Wed, 7 Jan 2015 11:24:45 -0700 Subject: [PATCH] Fixed promise chain on install --- install.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/install.js b/install.js index 44a23e635..d270f9de8 100644 --- a/install.js +++ b/install.js @@ -8,7 +8,6 @@ var Promise = require("nodegit-promise"); var promisify = require("promisify-node"); var fse = promisify(require("fs-extra")); var findParentDir = promisify(require('find-parent-dir')); -fse.ensureDir = promisify(fse.ensureDir, function() { return true; }); var exec = promisify(function(command, opts, callback) { return require("child_process").exec(command, opts, callback); @@ -69,10 +68,17 @@ if (NODE_VERSION === 0.1) { pkg.http_parser = pkg.http_parser["0.10"]; } -fse.ensureDir(path.resolve(__dirname, paths.release)) -.then(detectNodeWebkit.call(null, __dirname)) -.then(fetch) -.then(finish, compile); +// ensureDir doesn't promisify correctly so right now just use the callback +fse.ensureDir(path.resolve(__dirname, paths.release), function(err) { + if (err) { + console.log(err); + } + else { + detectNodeWebkit.call(null, __dirname) + .then(fetch) + .then(finish, compile); + } +}); function fetch() { console.info("[nodegit] Fetching binary from S3.");