Only validate a file if it ends with ".yaml".

Otherwise we try to validate vim .swp files.
markjh/node_swagger_validator
Mark Haines 9 years ago
parent 895ffcfcde
commit 385b6c4759

@ -44,7 +44,8 @@ if (isDir) {
process.exit(1);
}
files.forEach(function(f) {
if (f.indexOf(".yaml") > 0) {
var suffix = ".yaml";
if (f.indexOf(suffix, f.length - suffix.length) > 0) {
parser.parse(path.join(opts.schema, f), function(err, api, metadata) {
if (!err) {
console.log("%s is valid.", f);

Loading…
Cancel
Save