Permalink
Browse files

It should shows an error when `bower install` failed, fixes #922

- reason no bower.json in current directory
  • Loading branch information...
1 parent 4af17f0 commit 9b81ddf4d51aa13e5b0350e73558d770f19a2b10 @insanehong insanehong committed with sheerun Jul 2, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −0 lib/core/Project.js
  2. +0 −6 test/commands/install.js
View
@@ -47,6 +47,12 @@ Project.prototype.install = function (decEndpoints, options, config) {
// Analyse the project
return this._analyse()
.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
that.walkTree(tree, function (node, name) {
if (node.incompatible) {
View
@@ -19,12 +19,6 @@ describe('bower install', function () {
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 () {
this.timeout(10000);
var logger = bower.commands.install(['underscore'], undefined, config);

0 comments on commit 9b81ddf

Please sign in to comment.