Skip to content

Commit

Permalink
exit code on schema generation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
gallayl committed Jun 2, 2024
1 parent 5274b7d commit d2111b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/src/bin/create-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ export const exec = async (): Promise<void> => {
expose: 'all',
}).createSchema(schemaValue.type)
await promises.writeFile(outputFile, JSON.stringify(schema, null, 2))
console.log(`Schema generated succesfully.`)
} catch (error) {
console.error(`There was an error generating schema from ${schemaValue.inputFile}`, error)
throw error
}
}),
)
}

exec()
exec().catch((error) => {
console.error('Schema generation failed', error)
process.exit(1)
})

0 comments on commit d2111b1

Please sign in to comment.