Permalink
Browse files

YUITest Build

  • Loading branch information...
1 parent d598be3 commit 2e704ed807cef32fd502bc0d33a3dd816a92454d @davglass davglass committed Aug 17, 2012
@@ -5,6 +5,7 @@
*/
var fs = require("fs"),
path = require("path"),
+ exists = fs.existsSync || path.existsSync,
vm = null,
YUITest = require("yuitest"),
stdout = process.stdout,
@@ -54,8 +55,14 @@ YUITest.CLI = {
}
},
- isDirectory: function(name){
- return fs.statSync(name).isDirectory();
+ isDirectory: function(name) {
+ if (exists(name)) {
+ var stat = fs.statSync(name);
+ return stat.isDirectory();
+ } else {
+ this.warn('File Not Found: ' + name);
+ this.quit(1);
+ }
},
getFiles: function(dir){
@@ -4,6 +4,7 @@
*/
var fs = require("fs"),
path = require("path"),
+ exists = fs.existsSync || path.existsSync,
vm = null,
YUITest = require("yuitest"),
stdout = process.stdout,
@@ -53,8 +54,14 @@ YUITest.CLI = {
}
},
- isDirectory: function(name){
- return fs.statSync(name).isDirectory();
+ isDirectory: function(name) {
+ if (exists(name)) {
+ var stat = fs.statSync(name);
+ return stat.isDirectory();
+ } else {
+ this.warn('File Not Found: ' + name);
+ this.quit(1);
+ }
},
getFiles: function(dir){
Oops, something went wrong.
@@ -4,6 +4,7 @@
*/
var fs = require("fs"),
path = require("path"),
+ exists = fs.existsSync || path.existsSync,
vm = null,
YUITest = require("yuitest"),
stdout = process.stdout,
@@ -53,8 +54,14 @@ YUITest.CLI = {
}
},
- isDirectory: function(name){
- return fs.statSync(name).isDirectory();
+ isDirectory: function(name) {
+ if (exists(name)) {
+ var stat = fs.statSync(name);
+ return stat.isDirectory();
+ } else {
+ this.warn('File Not Found: ' + name);
+ this.quit(1);
+ }
},
getFiles: function(dir){

0 comments on commit 2e704ed

Please sign in to comment.