diff --git a/Gruntfile.js b/Gruntfile.js index ef6aff9fd7..5b598d78e4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -12,8 +12,6 @@ var overrides = require('./core/server/overrides'), chalk = require('chalk'), fs = require('fs-extra'), path = require('path'), - Promise = require('bluebird'), - Git = require('git-wrapper'), escapeChar = process.platform.match(/^win/) ? '^' : '\\', cwd = process.cwd().replace(/( |\(|\))/g, escapeChar + '$1'), @@ -703,78 +701,6 @@ var overrides = require('./core/server/overrides'), grunt.registerTask('dev', 'Dev Mode; watch files and restart server on changes', ['bgShell:client', 'express:dev', 'watch']); - // ### Contributors - // `grunt contributors:` - generate a comma-separated list of contributors for a Ghost release. - // - // You must supply a tag name to us - // - grunt.registerTask('contributors', 'Generate a list of contributors for a release', function () { - var getContribList = require('gh-contrib-list'), - oauthKey = process.env.GITHUB_OAUTH_KEY, - thisGit = new Git(), - clientGit = new Git({'git-dir': path.resolve(cwd + '/core/client/.git')}), - done = this.async(); - - function mergeContribs(first, second) { - _.each(second, function (contributor) { - var contributorInFirst = _.find(first, ['id', contributor.id]); - - if (contributorInFirst) { - contributorInFirst.commitCount += contributor.commitCount; - } else { - first.push(contributor); - } - }); - - return _.orderBy(first, ['commitCount'], ['desc']); - } - - if (!this.args) { - grunt.log.error('You must supply a tag name. Please run like this: `grunt contributors:`'); - } - - return Promise.props({ - ghost: Promise.promisify(thisGit.exec, {context: thisGit})('rev-list', {n: 1}, this.args), - admin: Promise.promisify(clientGit.exec, {context: clientGit})('rev-list', {n: 1}, this.args) - }).then(function (props) { - return Promise.join( - getContribList({ - user: 'tryghost', - repo: 'ghost', - oauthKey: oauthKey, - commit: props.ghost.trim(), - removeGreenkeeper: true, - retry: true - }), - getContribList({ - user: 'tryghost', - repo: 'ghost-admin', - oauthKey: oauthKey, - commit: props.admin.trim(), - removeGreenkeeper: true, - retry: true - }) - ); - }).then(function (results) { - var contributors = mergeContribs(results[0], results[1]); - - grunt.log.writeln(_.map(contributors, 'name').join(', ')); - done(); - }).catch(function (error) { - grunt.log.error(error); - - if (error.http_status) { - grunt.log.writeln('GitHub API request returned status: ' + error.http_status); - } - - if (error.ratelimit_limit) { - grunt.log.writeln('Rate limit data: limit: %d, remaining: %d, reset: %s', error.ratelimit_limit, error.ratelimit_remaining, require('moment').unix(error.ratelimit_reset).fromNow()); - } - - done(false); - }); - }); - // ### Release // Run `grunt release` to create a Ghost release zip file. // Uses the files specified by `.npmignore` to know what should and should not be included. diff --git a/package.json b/package.json index e6c849bc9f..ab3b29d8e4 100644 --- a/package.json +++ b/package.json @@ -80,8 +80,6 @@ "mysql": "2.11.1" }, "devDependencies": { - "gh-contrib-list": "0.1.2", - "git-wrapper": "0.1.1", "grunt": "1.0.1", "grunt-bg-shell": "2.3.3", "grunt-cli": "1.2.0",