Skip to content

Commit

Permalink
either works or freezes up on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Feb 21, 2011
1 parent bbd7b91 commit 65acb0e
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions index.js
Expand Up @@ -47,28 +47,38 @@ exports = module.exports = function (opts) {
}

var included = {};
var pending = 0;

(opts.require || []).concat('es5-shim').forEach(function npmWrap (name) {
if (!included[name]) {
pending ++;
Seq.ap((opts.require || []).concat('es5-shim'))
.parEach(5, function npmWrap (name) {
if (included[name]) { this(); return }
var next = this;

included[name] = true;

npmPackage(name, function (err, psrc, deps) {
pending --;
Object.keys(deps).forEach(npmWrap);
console.log(name);
if (name === 'es5-shim') {
preSrc += psrc;
}
else {
src += psrc;
}

if (pending === 0 && opts.ready) {
opts.ready();
}
console.dir(deps);
Seq.ap(Object.keys(deps))
.seqEach(function (dep) {
console.log(name + '.' + dep);
npmWrap.call(this, dep);
})
.seq(function () { next() })
.catch(next)
;
});
}
});
})
.seq(function () {
if (opts.ready) opts.ready()
})
;

var modified = new Date();
var preSrc = (opts.filter || String)(
Expand Down

0 comments on commit 65acb0e

Please sign in to comment.