FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #339 from nodegit/fix-issue-334 · javascript-forks/nodegit.nodegit@c095eea · GitHub

Repository navigation

Commit c095eea

Browse files
committed
Merge pull request nodegit#339 from nodegit/fix-issue-334
Fixed promise chain on install
2 parents 3b83ff3 + 7846974 commit c095eea

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎install.js‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var Promise = require("nodegit-promise");
88
var promisify = require("promisify-node");
99
var fse = promisify(require("fs-extra"));
1010
var findParentDir = promisify(require('find-parent-dir'));
11-
fse.ensureDir = promisify(fse.ensureDir, function() { return true; });
1211

1312
var exec = promisify(function(command, opts, callback) {
1413
return require("child_process").exec(command, opts, callback);
@@ -69,10 +68,17 @@ if (NODE_VERSION === 0.1) {
6968
pkg.http_parser = pkg.http_parser["0.10"];
7069
}
7170

72-
fse.ensureDir(path.resolve(__dirname, paths.release))
73-
.then(detectNodeWebkit.call(null, __dirname))
74-
.then(fetch)
75-
.then(finish, compile);
71+
// ensureDir doesn't promisify correctly so right now just use the callback
72+
fse.ensureDir(path.resolve(__dirname, paths.release), function(err) {
73+
if (err) {
74+
console.log(err);
75+
}
76+
else {
77+
detectNodeWebkit.call(null, __dirname)
78+
.then(fetch)
79+
.then(finish, compile);
80+
}
81+
});
7682

7783
function fetch() {
7884
console.info("[nodegit] Fetching binary from S3.");

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL