Skip to content

Commit

Permalink
Code style for inquirer merge
Browse files Browse the repository at this point in the history
  • Loading branch information
passy committed May 30, 2013
1 parent 190677b commit 5c38867
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/actions/prompt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var inquirer = require("inquirer");
var inquirer = require('inquirer');

// Prompt for user input based on the given Array of `prompts` to perform in
// series, and call `done` callback on completion.
Expand Down
34 changes: 15 additions & 19 deletions lib/util/conflicter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,40 +66,36 @@ conflicter._ask = function (filepath, content, cb) {
var self = this;

var config = [{
type: "rawlist",
message: ('Overwrite ' + filepath + '?'),
type: 'rawlist',
message: 'Overwrite ' + filepath + '?',
choices: [
{
name: "Overwrite",
name: 'Overwrite',
value: function () {
log.force(filepath);
return cb('force');
}
},
{
name: "do not overwrite",
}, {
name: 'do not overwrite',
value: function () {
log.skip(filepath);
return cb('skip');
}
},
{
name: "overwrite this and all others",
}, {
name: 'overwrite this and all others',
value: function () {
log.force(filepath);
self.force = true;
return cb('force');
}
},
{
name: "abort",
}, {
name: 'abort',
value: function () {
log.writeln('Aborting...');
log.writeln('Aborting ...');
return process.exit(0);
}
},
{
name: "show the differences between the old and the new",
}, {
name: 'show the differences between the old and the new',
value: function () {
console.log(conflicter.diff(fs.readFileSync(filepath, 'utf8'), content));
return self._ask(filepath, content, cb);
Expand All @@ -110,9 +106,9 @@ conflicter._ask = function (filepath, content, cb) {
}];

process.nextTick(function () {
self.emit('prompt', config);
self.emit('conflict', filepath);
});
this.emit('prompt', config);
this.emit('conflict', filepath);
}.bind(this));

prompt(config, function (result) {
cb(result.overwrite());
Expand Down

0 comments on commit 5c38867

Please sign in to comment.