all-contributors-cli/lib/contributors/index.js

17 lines
472 B
JavaScript
Raw Normal View History

2016-03-02 22:45:23 +00:00
'use strict';
var add = require('./add');
var github = require('./github');
2016-03-27 15:08:25 +00:00
var configFile = require('../util').configFile;
2016-03-02 22:45:23 +00:00
module.exports = function addContributor(options, username, contributions, cb) {
2016-03-06 23:20:24 +00:00
add(options, username, contributions, github, function (error, contributors) {
2016-03-02 22:45:23 +00:00
if (error) {
return cb(error);
}
2016-03-06 23:20:24 +00:00
configFile.writeContributors(options.config, contributors, function (error) {
2016-03-02 22:45:23 +00:00
return cb(error, contributors);
});
});
};