Skip to content

Commit

Permalink
It should shows an error when bower install failed, fixes #922
Browse files Browse the repository at this point in the history
- reason no bower.json in current directory
  • Loading branch information
insanehong authored and sheerun committed Jul 3, 2014
1 parent 4af17f0 commit 9b81ddf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lib/core/Project.js
Expand Up @@ -47,6 +47,12 @@ Project.prototype.install = function (decEndpoints, options, config) {
// Analyse the project // Analyse the project
return this._analyse() return this._analyse()
.spread(function (json, tree) { .spread(function (json, tree) {
// It shows an error when issuing `bower install`
// and no bower.json is present in current directory
if(!that._jsonFile && decEndpoints.length === 0 ) {
throw createError('No bower.json present', 'ENOENT');
}

// Recover tree // Recover tree
that.walkTree(tree, function (node, name) { that.walkTree(tree, function (node, name) {
if (node.incompatible) { if (node.incompatible) {
Expand Down
6 changes: 0 additions & 6 deletions test/commands/install.js
Expand Up @@ -19,12 +19,6 @@ describe('bower install', function () {
interactive: true interactive: true
}; };


it('does nothing if no bower.json is present', function () {
var logger = bower.commands.install([], undefined, config);

return helpers.expectEvent(logger, 'end');
});

it.skip('installs a package', function () { it.skip('installs a package', function () {
this.timeout(10000); this.timeout(10000);
var logger = bower.commands.install(['underscore'], undefined, config); var logger = bower.commands.install(['underscore'], undefined, config);
Expand Down

0 comments on commit 9b81ddf

Please sign in to comment.