Skip to content

Commit

Permalink
fix: dont fail if schemas folder isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jun 30, 2021
1 parent f7d4420 commit b12dc79
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/commands/schema/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export default class SchemaCompare extends SnapshotCommand {

public async run(): Promise<SchemaComparison> {
const {flags} = this.parse(SchemaCompare)

try {
fs.accessSync(flags.filepath)
} catch {
this.log(`${flags.filepath} not found.`)
return []
}

const existingSchema = this.readExistingSchema(flags.filepath)
const latestSchema = await this.generateLatestSchema()

Expand Down

0 comments on commit b12dc79

Please sign in to comment.