Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newer version of inquirer used #24

Merged
merged 1 commit into from Nov 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 20 additions & 2 deletions lib/commit.js
Expand Up @@ -40,6 +40,7 @@ module.exports = function(cb) {
inquirer.prompt([{
type: 'checkbox',
name: 'files',
pageSize: 30,
message: 'Select files to commit/add. ' +
clc.xterm(236)('Press ENTER for the next step'),
choices: statusFiles,
Expand All @@ -52,13 +53,30 @@ module.exports = function(cb) {
});
var filesToAdd = files.filter(function(file) {
return file.split(' ')[0] === 'unversioned';
}).map(function(file){
return file.split(' ')[1];
});
var filesToCommit = files.filter(function(file){
return file.split(' ')[0] === 'modified';
}).map(function(file){
return file.split(' ')[1];
});

console.log('FILES TO ADD: ', filesToAdd);
console.log('FILES TO Commit: ', filesToCommit);

if (filesToAdd.length) {
console.log('FILES TO ADD: ');
filesToAdd.forEach(function(file){
console.log(' - ' + clc.xterm(227)(file));
});
}

if (filesToCommit.length) {
console.log('FILES TO COMMIT: ');
filesToCommit.forEach(function(file){
console.log(' - ' + clc.xterm(227)(file));
});
}

});
//cb();
});
Expand Down