Skip to content

Commit

Permalink
syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonpecora committed Jan 18, 2017
1 parent 680c5d4 commit 4403aa4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ function getSchema(dir) {
}

function getSchemaPath(dir) {
if (fs.existsSync(path.join(dir, 'schema.yml'))) {
return path.join(dir, 'schema.yml');
} else if (fs.existsSync(path.join(dir, 'schema.yaml'))) {
return path.join(dir, 'schema.yaml');
const ymlPath = path.join(dir, 'schema.yml'),
yamlPath = path.join(dir, 'schema.yaml');

if (fs.existsSync(ymlPath)) {
return ymlPath;
} else if (fs.existsSync(yamlPath)) {
return yamlPath;
} else {
throw new Error('Schema path not found!');
}
Expand Down

0 comments on commit 4403aa4

Please sign in to comment.