Skip to content

Commit

Permalink
Add force flag to codegen bin
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewosh committed Sep 5, 2024
1 parent 55a203c commit cceaef3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builder/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const Builder = require('./')
const args = process.argv.slice(2)
const input = args[0]
const output = args[1]
const testing = args[2] === '--test-fixture'
const testing = args.includes('--test-fixture')
const force = args.includes('--force')
if (!input || !output) {
console.error('Usage: hyperdb [input.js] [outputDir]')
process.exit(1)
Expand Down Expand Up @@ -47,7 +48,7 @@ if (testing) {
const next = require(inputSchemaPath)({ previous })
const { json, messages, db } = runtime ? next.compile({ runtime }) : next.compile()

if (previous && (json.version === previousJson.version)) {
if (!force && (previous && (json.version === previousJson.version))) {
console.log('Schema has not been changed.')
process.exit(0)
}
Expand Down

0 comments on commit cceaef3

Please sign in to comment.