Examine all passed names in the template check

This commit is contained in:
kpdecker
2011-08-22 01:35:26 -05:00
parent 48726c7fed
commit 6eea3e4d44
+10 -7
View File
@@ -25,15 +25,18 @@ var optimist = require('optimist')
})
.check(function(argv) {
var template = argv._[0];
if (!template) {
var template = [0];
if (!argv._.length) {
throw 'Must define at least one template or directories.';
}
try {
fs.statSync(argv._[0]);
} catch (err) {
throw 'Unable to open template file "' + template + '"';
}
argv._.forEach(function(template) {
try {
fs.statSync(template);
} catch (err) {
throw 'Unable to open template file "' + template + '"';
}
});
});
var fs = require('fs'),