Skip to content
This repository was archived by the owner on Jan 5, 2025. It is now read-only.

Commit b58c3ad

Browse files
author
Sergej Tatarincev
committed
Merge pull request #6 from scf2k/interactive
Use prompt asking user to resolve a conflict. Use --non-interactive to disable interactive mode.
2 parents 805322d + 7a7344a commit b58c3ad

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

lib/coa.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,20 @@ module.exports = require('coa').Cmd()
4343
.long('force-latest')
4444
.flag()
4545
.end()
46+
.opt()
47+
.name('non-interactive')
48+
.title('Do not use interactive mode when executing ' + C.blueBright('bower install'))
49+
.long('non-interactive')
50+
.flag()
51+
.end()
4652
.completable()
4753
.act(function(opts) {
4854
var defer = Q.defer(),
4955
config = {
5056
verbose: false,
5157
cwd: process.cwd(),
52-
color: true
58+
color: true,
59+
interactive: !opts['non-interactive']
5360
},
5461
renderer = new StandardRenderer('install', config);
5562

lib/install.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ var PATH = require('path'),
77
L = require('lodash'),
88
QFS = require('q-io/fs'),
99
Logger = require('bower/node_modules/bower-logger'),
10-
byline = require('byline');
10+
byline = require('byline'),
11+
inquirer = require('inquirer');
1112

1213
module.exports = function(paths, options, config) {
1314
options = L.extend({}, options || {});
@@ -51,6 +52,9 @@ function bowerInstall(paths, options, config) {
5152
})
5253
.on('end', function(installed) {
5354
d.resolve(installed);
55+
})
56+
.on('prompt', function (prompts, callback) {
57+
inquirer.prompt(prompts, callback);
5458
});
5559

5660
return d.promise;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"lodash": "~1.3.1",
2424
"cli-color": "~0.2.2",
2525
"update-notifier": "~0.1.3",
26-
"byline": "git://github.com/SevInf/node-byline.git#2c546e682d503667ead0001090ecb9f27f62d928"
26+
"byline": "git://github.com/SevInf/node-byline.git#2c546e682d503667ead0001090ecb9f27f62d928",
27+
"inquirer": "~0.3.0"
2728
},
2829
"peerDependencies": {
2930
"bower": "~1.2.7"

0 commit comments

Comments
 (0)