diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d59881c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +sudo: false +node_js: + - "4" + - "5" + - "6" \ No newline at end of file diff --git a/exec-git.js b/exec-git.js deleted file mode 100644 index 1bd6edf..0000000 --- a/exec-git.js +++ /dev/null @@ -1,66 +0,0 @@ -var Promise = require('bluebird').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