Permalink
Browse files

Warn when files were not found or matched include/exclude patterns, c…

…loses #5.

Bump version as well, w00t!
  • Loading branch information...
1 parent b5bb6c7 commit 98a0e6c05dbfa99e035cefec2794484d1235f303 @StanAngeloff committed Sep 7, 2012
Showing with 14 additions and 2 deletions.
  1. +13 −1 bin/cli.js
  2. +1 −1 package.json
View
@@ -88,7 +88,7 @@ if (defaults.help) {
process.exit(0);
}
if (defaults.version) {
- console.log('%s %s', defaults.$0, '0.2.0-1');
+ console.log('%s %s', defaults.$0, '0.2.1');
process.exit(0);
}
@@ -154,8 +154,20 @@ function main(options) {
options || (options = {});
verifyPhantomBinary(options, function() {
collect(options, function(files) {
+ if ( ! files.length) {
+ console.warn("No files were found in '%s'.", options.path);
+ process.exit(0);
+ }
glob(files, { mode: 'include', pattern: options.include }, function(files) {
+ if ( ! files.length) {
+ console.warn("Files were found in '%s', but none matched your include pattern '%s'.", options.path, options.include);
+ process.exit(0);
+ }
glob(files, { mode: 'exclude', pattern: options.exclude }, function(files) {
+ if ( ! files.length) {
+ console.warn("Files were found in '%s', but all matched your exclude pattern '%s'.", options.path, options.exclude);
+ process.exit(0);
+ }
var server = require('../lib/server');
files.sort(require('naturalsort').compare);
options.files = files;
View
@@ -1,5 +1,5 @@
{ "name": "lotte",
- "version": "0.2.0-1",
+ "version": "0.2.1",
"description": "Headless, automated browser testing using PhantomJS",
"homepage": "https://github.com/StanAngeloff/lotte",
"bugs": "https://github.com/StanAngeloff/lotte/issues",

0 comments on commit 98a0e6c

Please sign in to comment.