From 1176a3df404c3963707d5226af20d7c0c476d25b Mon Sep 17 00:00:00 2001 From: Chien-hung Chen Date: Mon, 5 Jan 2015 11:10:35 +0800 Subject: [PATCH 01/24] jshint/jscs fix --- gulpfile.js | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1711300..e244dfb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,7 +20,7 @@ gulp.task('default', function () { git_sha: process.env.TRAVIS_COMMIT, jshint_status: 'error', - jscs_status: 'failure', + jscs_status: 'failure' })) .pipe(jshint.reporter('fail')); }); diff --git a/index.js b/index.js index 88c5731..0c43a61 100644 --- a/index.js +++ b/index.js @@ -45,7 +45,7 @@ createStatusToCommit = function (state, opt) { description: state.description, context: state.context }); -} +}; module.exports = function (options) { var jshint_output = ['**Please fix these jshint issues first:**'], From c99ec77ebad8f1bee8aa1f4fa36b1935e4f3bb79 Mon Sep 17 00:00:00 2001 From: Chien-hung Chen Date: Mon, 5 Jan 2015 11:14:18 +0800 Subject: [PATCH 02/24] refine doc --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f25071..2c12ffd 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,10 @@ A gulp plugin to pipe contents to github pull request comments. Features -------- -* Write collected info then comment on a github pull request. * Collect gulp-jshint results. * Collect gulp-jscs results. +* Write collected info then comment on a github pull request. +* Update github pull request status based on collected info. * **TODO** Collect lcov result. Installation From 9917d507a4b0cd182172695fd00d3fc58a2cfa6c Mon Sep 17 00:00:00 2001 From: Chien-hung Chen Date: Mon, 5 Jan 2015 11:14:34 +0800 Subject: [PATCH 03/24] Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c95847..bb51eae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-github", - "version": "0.1.0", + "version": "0.2.0", "description": "A gulp plugin to pipe contents to github pull request comments.", "author": "Zordius ", "contributors": [ From c35c4f028662d9a26388f14e04c060a9a56c5dd7 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 11:20:40 +0800 Subject: [PATCH 04/24] fix for process.env.TRAVIS_PULL_REQUEST = 'false' issue --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0c43a61..6208f44 100644 --- a/index.js +++ b/index.js @@ -76,7 +76,7 @@ module.exports = function (options) { return cb(); } - if (opt.git_token && opt.git_repo && opt.git_prid) { + if (opt.git_token && opt.git_repo && opt.git_prid && (opt.git_prid !== 'false')) { pr_url = 'https://' + ((opt.git_option && opt.git_option.host) ? opt.git_option.host : 'github.com') + '/' + opt.git_repo + '/pull/' + opt.git_prid; if (jshint_output.length > 1) { commentToPR(jshint_output.join('\n'), opt); From ead090c692505a06b1017ff513cf4f2a4f795ba6 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 11:20:58 +0800 Subject: [PATCH 05/24] test --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6208f44..fafce3d 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ module.exports = function (options) { var pr_url; if ((jshint_output.length === 1) && (jscs_output.length === 1)) { - return cb(); + return cb() } if (opt.git_token && opt.git_repo && opt.git_prid && (opt.git_prid !== 'false')) { From dc65b66d36526f081a9647943ce95af6394d3e61 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 11:24:45 +0800 Subject: [PATCH 06/24] more doc --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2c12ffd..7d0527b 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,5 @@ Options ``` Check this sample gulpfile to see how to migrate this with travis CI. + +Check This PR to see live demo. Click on ✘ symbol before d9bc05e to see created status. From 3a17747f9eec8a0d6d250f9658bede7322ecb97c Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 11:24:58 +0800 Subject: [PATCH 07/24] fix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fafce3d..6208f44 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ module.exports = function (options) { var pr_url; if ((jshint_output.length === 1) && (jscs_output.length === 1)) { - return cb() + return cb(); } if (opt.git_token && opt.git_repo && opt.git_prid && (opt.git_prid !== 'false')) { From 8c7b4ae30fadb3030e5f6251803ce856e26bf0bd Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 11:26:40 +0800 Subject: [PATCH 08/24] more doc --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index e244dfb..aa5cec6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,8 +19,8 @@ gulp.task('default', function () { git_prid: process.env.TRAVIS_PULL_REQUEST, git_sha: process.env.TRAVIS_COMMIT, - jshint_status: 'error', - jscs_status: 'failure' + jshint_status: 'error', // Set status to error when jshint errors + jscs_status: 'failure' // Set status to failure when jscs errors })) .pipe(jshint.reporter('fail')); }); From f88a397c9515006687987597e7eb418760c36a32 Mon Sep 17 00:00:00 2001 From: Chien-hung Chen Date: Mon, 5 Jan 2015 12:22:17 +0800 Subject: [PATCH 09/24] fix jscs status report bug --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 6208f44..c03eac1 100644 --- a/index.js +++ b/index.js @@ -108,7 +108,9 @@ module.exports = function (options) { context: 'gulp-github/jshint' }, opt); } + } + if (jscs_output.length > 1) { if (opt.jscs_status) { createStatusToCommit({ state: opt.jscs_status, From 190b49a3e4a056884ff0baf86156fb135175a613 Mon Sep 17 00:00:00 2001 From: Chien-hung Chen Date: Mon, 5 Jan 2015 12:27:16 +0800 Subject: [PATCH 10/24] export createStatusToCommit --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index c03eac1..54e92df 100644 --- a/index.js +++ b/index.js @@ -126,3 +126,4 @@ module.exports = function (options) { }; module.exports.commentToPR = commentToPR; +module.exports.createStatusToCommit = createStatusToCommit; From 1cf423119b3cf62467f8b627fabf144facede4a5 Mon Sep 17 00:00:00 2001 From: Chien-hung Chen Date: Mon, 5 Jan 2015 12:29:42 +0800 Subject: [PATCH 11/24] add more doc --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 7d0527b..4ec48c1 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,13 @@ gulp.task('link_report_github', function () { // Or, direct output your comment with same options github.commentToPR('Yes! it works!!', options); + +// Or, direct set status to a commit +github.createStatusToCommit({ + description: 'No! 2 failures...', + context: 'my gulp task', + state: 'failure' +}, options); ``` Options From e1503a1f52e437105c1a4228341474e658a9cd53 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 12:57:09 +0800 Subject: [PATCH 12/24] update style --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ec48c1..9b14201 100644 --- a/README.md +++ b/README.md @@ -90,4 +90,4 @@ Options Check this sample gulpfile to see how to migrate this with travis CI. -Check This PR to see live demo. Click on ✘ symbol before d9bc05e to see created status. +Check This PR to see live demo. Click on symbol before d9bc05e to see created status. From 8688e4fa04374c8f88e7987e75b51595410b3cad Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 16:01:57 +0800 Subject: [PATCH 13/24] a new fail reporter for both jscs/jshint --- gulpfile.js | 2 +- index.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index aa5cec6..a041e54 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,5 +22,5 @@ gulp.task('default', function () { jshint_status: 'error', // Set status to error when jshint errors jscs_status: 'failure' // Set status to failure when jscs errors })) - .pipe(jshint.reporter('fail')); + .pipe(github.failThisTask()); }); diff --git a/index.js b/index.js index 54e92df..16ac5a6 100644 --- a/index.js +++ b/index.js @@ -45,6 +45,42 @@ createStatusToCommit = function (state, opt) { description: state.description, context: state.context }); +}, + +failThisTask = function () { + var jshint_fails = 0, + jscs_fails = 0; + + return through.obj(function (file, enc, callback) { + if (file.jshint && !file.jshint.success && !file.jshint.ignored) { + jshint_fails += file.jshint.results.length; + } + + if (file.jscs && !file.jscs.success) { + jscs_fails += file.jscs.errors.length; + } + this.push(file); + callback(); + }, function (cb) { + var message = []; + + if (jshint_fails) { + message.push('found ' + jshint_fails + ' jshint issues'); + } + + if (jscs_fails) { + message.push('found ' + jscs_fails + ' jscs issues'); + } + + if (message.length) { + this.emit('error', new gutil.PluginError('gulp-github', { + message: 'Failed: ' + message.join(', ') + '.', + showStack: false + })); + } + + cb(); + }); }; module.exports = function (options) { @@ -127,3 +163,4 @@ module.exports = function (options) { module.exports.commentToPR = commentToPR; module.exports.createStatusToCommit = createStatusToCommit; +module.exports.failThisTask = failThisTask; From f8a426d80cd52522c88f0279f7f9e60b700e482d Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Mon, 5 Jan 2015 16:03:17 +0800 Subject: [PATCH 14/24] update document --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b14201..b5549c0 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,10 @@ gulp.task('link_report_github', function () { return gulp.src('lib/*.js') .pipe(jshint()) .pipe(jscs()).on('error', function (E) { - console.log(E.message); // This handled jscs stream error + console.log(E.message); // This handled jscs stream error. }) - .pipe(github(options)); // comment issues in github PR! + .pipe(github(options)); // Comment issues in github PR! + .pipe(github.failThisTask()); // Fail this task when jscs/jshint issues found. }); // Or, direct output your comment with same options From fff17099ac7c99e4a3146ff36000078986ad39f2 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Tue, 6 Jan 2015 10:17:47 +0800 Subject: [PATCH 15/24] update doc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b5549c0..3ef648f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Features * Collect gulp-jscs results. * Write collected info then comment on a github pull request. * Update github pull request status based on collected info. +* A failThisTask() reporter to fail a gulp task when jscs/jshint issues found * **TODO** Collect lcov result. Installation From 13021f3d6c17ef983e30e3feab8fc8aae8125c62 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Tue, 6 Jan 2015 10:18:34 +0800 Subject: [PATCH 16/24] release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb51eae..e5cd696 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-github", - "version": "0.2.0", + "version": "0.2.1", "description": "A gulp plugin to pipe contents to github pull request comments.", "author": "Zordius ", "contributors": [ From 2cce3d54c59c4762d0013bcbecb17415aa92c008 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Wed, 14 Jan 2015 11:46:12 +0800 Subject: [PATCH 17/24] add failMergedPR() --- index.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 16ac5a6..ca2a7f5 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,15 @@ getGIT = function (opt) { return GIT; }, +closePR = function (opt) { + getGIT(opt).issues.update({ + user: opt.git_repo.split('/')[0], + repo: opt.git_repo.split('/')[1], + number: opt.git_prid, + state: 'closed' + }); +}, + commentToPR = function (body, opt) { getGIT(opt).issues.createComment({ user: opt.git_repo.split('/')[0], @@ -47,6 +56,56 @@ createStatusToCommit = function (state, opt) { }); }, +isPullRequest = function (opt) { + return opt.git_token && opt.git_repo && opt.git_prid && (opt.git_prid !== 'false'); +}, + +isMerge = function (opt, callback) { + if (!isPullRequest(opt)) { + return; + } + + getGIT(opt).pullRequests.getCommits({ + user: opt.git_repo.split('/')[0], + repo: opt.git_repo.split('/')[1], + number: opt.git_prid, + per_page: 100 + }, function (E, D) { + var merged = []; + + if (E) { + console.warn(E); + return callback(E); + } + + D.forEach(function (commit) { + if (commit.parents.length > 1) { + merged.push('* Commit: @' + commit.sha + ' is a merge from ' + commit.parents.map(function (C) { + return '@' + C.sha; + }).join(' , ') + ' !!'); + } + }); + + callback(merged.length ? merged.join('\n') : false); + }); +}, + +failMergedPR = function (opt) { + isMerge(opt, function (M) { + if (M) { + commentToPR('**Do not accept PR with merge, please use rebase always!**\n' + M, opt); + } + + createStatusToCommit({ + state: 'failure', + description: 'merge in PR', + context: 'gulp-github/is_merge' + }, opt); + + closePR(opt); + }); +}, + failThisTask = function () { var jshint_fails = 0, jscs_fails = 0; @@ -112,7 +171,7 @@ module.exports = function (options) { return cb(); } - if (opt.git_token && opt.git_repo && opt.git_prid && (opt.git_prid !== 'false')) { + if (isPullRequest(opt)) { pr_url = 'https://' + ((opt.git_option && opt.git_option.host) ? opt.git_option.host : 'github.com') + '/' + opt.git_repo + '/pull/' + opt.git_prid; if (jshint_output.length > 1) { commentToPR(jshint_output.join('\n'), opt); @@ -164,3 +223,5 @@ module.exports = function (options) { module.exports.commentToPR = commentToPR; module.exports.createStatusToCommit = createStatusToCommit; module.exports.failThisTask = failThisTask; +module.exports.failMergedPR = failMergedPR; +module.exports.isMerge = isMerge; From 84fa8fac2076e338609bbd81079f03dffdb08120 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Fri, 16 Jan 2015 17:23:48 +0800 Subject: [PATCH 18/24] fix failMergedPR logic --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ca2a7f5..2c7de13 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,7 @@ getGIT = function (opt) { }, closePR = function (opt) { - getGIT(opt).issues.update({ + getGIT(opt).issues.edit({ user: opt.git_repo.split('/')[0], repo: opt.git_repo.split('/')[1], number: opt.git_prid, @@ -92,10 +92,12 @@ isMerge = function (opt, callback) { failMergedPR = function (opt) { isMerge(opt, function (M) { - if (M) { - commentToPR('**Do not accept PR with merge, please use rebase always!**\n' + M, opt); + if (!M) { + return; } + commentToPR('**Do not accept PR with merge, please use rebase always!**\n' + M, opt); + createStatusToCommit({ state: 'failure', description: 'merge in PR', From 04dcbfa03d3062ddc2da2f066fbb0235d84d1739 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Wed, 2 Sep 2015 13:04:11 +0800 Subject: [PATCH 19/24] release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5cd696..d4e9b1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-github", - "version": "0.2.1", + "version": "0.2.2", "description": "A gulp plugin to pipe contents to github pull request comments.", "author": "Zordius ", "contributors": [ From c3ee1eb5c912e2d97f4bf38a5b8f4c0da759cc56 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Wed, 2 Sep 2015 16:27:51 +0800 Subject: [PATCH 20/24] update depdency and jscs cfg --- .jscsrc | 3 +-- package.json | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.jscsrc b/.jscsrc index eb0a3c4..d242367 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,5 +1,4 @@ { - "additionalRules": ["rules/disallow-dot-notation-for-keywords.js"], "fileExtensions": [".js", ".jsx"], "disallowMixedSpacesAndTabs": true, "disallowNewlineBeforeBlockStatements": true, @@ -41,7 +40,7 @@ "safeContextKeyword": ["self"], "validateIndentation": 4, - "validateJSDoc": { + "jsDoc": { "checkParamNames": true, "checkRedundantParams": true, "requireParamTypes": true, diff --git a/package.json b/package.json index d4e9b1e..0280c6a 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,14 @@ }, "main": "index.js", "dependencies": { - "github": "0.2.3", - "gulp-util": "3.0.1", + "github": "0.2.4", + "gulp-util": "3.0.6", "through2": "*" }, "devDependencies": { - "gulp": "3.8.10", - "gulp-jshint": "1.9.0", - "gulp-jscs": "1.4.0" + "gulp": "3.9.0", + "gulp-jshint": "1.11.2", + "gulp-jscs": "2.0.0" }, "engines": { "node": ">=0.8" From bae5af3d45f6e7c3f66af25b107ec63a2b08ff8d Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Wed, 2 Sep 2015 16:28:19 +0800 Subject: [PATCH 21/24] update depdency, release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0280c6a..13b6ed3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-github", - "version": "0.2.2", + "version": "0.2.3", "description": "A gulp plugin to pipe contents to github pull request comments.", "author": "Zordius ", "contributors": [ From 2763e17eaf490a9a97f78ea6d40ca121c5d8a8b7 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Thu, 22 Oct 2015 12:30:22 +0800 Subject: [PATCH 22/24] support callback --- index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 2c7de13..aa4c458 100644 --- a/index.js +++ b/index.js @@ -27,25 +27,25 @@ getGIT = function (opt) { return GIT; }, -closePR = function (opt) { +closePR = function (opt, cb) { getGIT(opt).issues.edit({ user: opt.git_repo.split('/')[0], repo: opt.git_repo.split('/')[1], number: opt.git_prid, state: 'closed' - }); + }, cb); }, -commentToPR = function (body, opt) { +commentToPR = function (body, opt, cb) { getGIT(opt).issues.createComment({ user: opt.git_repo.split('/')[0], repo: opt.git_repo.split('/')[1], number: opt.git_prid, body: body - }); + }, cb); }, -createStatusToCommit = function (state, opt) { +createStatusToCommit = function (state, opt, cb) { getGIT(opt).statuses.create({ user: opt.git_repo.split('/')[0], repo: opt.git_repo.split('/')[1], @@ -53,7 +53,7 @@ createStatusToCommit = function (state, opt) { state: state.state, description: state.description, context: state.context - }); + }, cb); }, isPullRequest = function (opt) { From 05ddfa89e6183cd5b47e698ee6d4413b21903400 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Thu, 22 Oct 2015 12:37:23 +0800 Subject: [PATCH 23/24] should be async --- index.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index aa4c458..e5e453e 100644 --- a/index.js +++ b/index.js @@ -90,21 +90,33 @@ isMerge = function (opt, callback) { }); }, -failMergedPR = function (opt) { +failMergedPR = function (opt, cb) { + var count = 0; + var err = []; + var done = function (E) { + count++; + if (E) { + err.push(E); + } + if ((count == 3) && cb) { + cb(err.length ? err : undefined); + } + }; + isMerge(opt, function (M) { if (!M) { return; } - commentToPR('**Do not accept PR with merge, please use rebase always!**\n' + M, opt); + commentToPR('**Do not accept PR with merge, please use rebase always!**\n' + M, opt, done); createStatusToCommit({ state: 'failure', description: 'merge in PR', context: 'gulp-github/is_merge' - }, opt); + }, opt, done); - closePR(opt); + closePR(opt, done); }); }, From e14303ce18ee8d4935864a57cdf8706d7bf9cfe0 Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Thu, 22 Oct 2015 12:41:05 +0800 Subject: [PATCH 24/24] should be async. test --- index.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e5e453e..97d0676 100644 --- a/index.js +++ b/index.js @@ -180,6 +180,13 @@ module.exports = function (options) { callback(); }, function (cb) { var pr_url; + var count = 0; + var done = function () { + count--; + if (count == 0) { + cb(); + } + }; if ((jshint_output.length === 1) && (jscs_output.length === 1)) { return cb(); @@ -209,28 +216,32 @@ module.exports = function (options) { } if (opt.git_token && opt.git_repo && opt.git_sha) { + count++; if (jshint_output.length > 1) { if (opt.jshint_status) { + count++; createStatusToCommit({ state: opt.jshint_status, description: (jshint_output.length - 1) + ' jshint issues found', context: 'gulp-github/jshint' - }, opt); + }, opt, done); } } if (jscs_output.length > 1) { if (opt.jscs_status) { + count++; createStatusToCommit({ state: opt.jscs_status, description: (jscs_output.length - 1) + ' jscs issues found', context: 'gulp-github/jscs' - }, opt); + }, opt, done); } } } - cb(); + count++; + done(); }); };