From 8d04a87a311fbf98aa5fab3787ffcc3978656962 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 6 Sep 2016 11:41:52 -0400 Subject: [PATCH 1/2] whitespace --- github.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github.js b/github.js index 4b4cf48..e9b54e0 100644 --- a/github.js +++ b/github.js @@ -565,7 +565,7 @@ GithubLocation.prototype = { if (release.type == 'tar') { (inPipe = zlib.createGunzip()) .pipe(tar.Extract({ - path: outDir, + path: outDir, strip: 0, filter: function() { return !this.type.match(/^.*Link$/); @@ -780,7 +780,7 @@ GithubLocation.prototype = { // src.zip comes after file.zip return asset.name.indexOf('src') == -1 ? -1 : 1; })[0]; - + if (!firstAsset) return false; From 0f3209b9ec8c92e5a58029ea23de487d1787776a Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 6 Sep 2016 11:03:34 -0400 Subject: [PATCH 2/2] Use the GitHub API for all operations Fixes #99. --- exec-git.js | 66 ------------------------------------- github.js | 92 +++++++++++++++++++++------------------------------- test/pool.js | 35 -------------------- 3 files changed, 37 insertions(+), 156 deletions(-) delete mode 100644 exec-git.js delete mode 100644 test/pool.js diff --git a/exec-git.js b/exec-git.js deleted file mode 100644 index 0019457..0000000 --- a/exec-git.js +++ /dev/null @@ -1,66 +0,0 @@ -var Promise = require('rsvp').Promise; -var exec = require('child_process').exec; -var os = require('os'); - -function Pool(count) { - this.count = count; - this.queue = []; - this.promises = new Array(count); -} - -/* Run the function immediately. */ -function run(pool, idx, executionFunction) { - var p = Promise.resolve() - .then(executionFunction) - .then(function() { - delete pool.promises[idx]; - var next = pool.queue.pop(); - if (next) - pool.execute(next); - }); - pool.promises[idx] = p; - return p; -} - -/* Defer function to run once all running and queued functions have run. */ -function enqueue(pool, executeFunction) { - return new Promise(function(resolve) { - pool.queue.push(function() { - return Promise.resolve().then(executeFunction).then(resolve); - }); - }); -} - -/* Take a function to execute within pool, and return promise delivering the functions - * result immediately once it is run. */ -Pool.prototype.execute = function(executionFunction) { - var idx = -1; - - for (var i=0; i