Skip to content

Commit

Permalink
Fix a bug with JSHint CLI crashing when file is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
valueof committed Jan 2, 2013
1 parent 815dae1 commit bc538da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ function collect(fp, files, ignores, ext) {
return;
}

if (!shjs.test("-e", fp)) {
cli.error("Can't open " + fp);
return;
}

if (shjs.test("-d", fp)) {
shjs.ls(fp).forEach(function (item) {
var itempath = path.join(fp, item);
Expand Down

0 comments on commit bc538da

Please sign in to comment.