From b12dc796619fe2469b2b4ea8fc524f999b1c614e Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 30 Jun 2021 13:54:15 -0600 Subject: [PATCH] fix: dont fail if schemas folder isn't found --- src/commands/schema/compare.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/schema/compare.ts b/src/commands/schema/compare.ts index d5d151c4..71386c47 100644 --- a/src/commands/schema/compare.ts +++ b/src/commands/schema/compare.ts @@ -21,6 +21,14 @@ export default class SchemaCompare extends SnapshotCommand { public async run(): Promise { 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()