Skip to content

Commit

Permalink
fix: Skip missing dirs for invalid entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian committed Jul 5, 2019
1 parent 7869c6b commit 758913f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/SchemaGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,14 @@ Files were exported from https://github.com/ffflorian/schemastore-updater/tree/m

for (const entry of Object.keys(lockFileData)) {
const name = entry.replace('.json', '');
const packageJson = fs.readJsonSync(`./schemas/${name}/package.json`);
const lockFileVersion = lockFileData[entry].version;
if (lockFileVersion !== packageJson.version) {
invalidEntries.push(entry);
const fileName = `./schemas/${name}/package.json`;
const fileIsReadable = await this.fileIsReadable(fileName);
if (fileIsReadable) {
const packageJson = await fs.readJson(fileName);
const lockFileVersion = lockFileData[entry].version;
if (lockFileVersion !== packageJson.version) {
invalidEntries.push(entry);
}
}
}

Expand Down

0 comments on commit 758913f

Please sign in to comment.