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