diff --git a/joyce-api/src/scripts/generate-models.js b/joyce-api/src/scripts/generate-models.js index 4d422149..8b55ff63 100644 --- a/joyce-api/src/scripts/generate-models.js +++ b/joyce-api/src/scripts/generate-models.js @@ -106,7 +106,7 @@ async function run() { } // compare computed schemas hashes, if they differ we exit with a code to let npm script do a mesh build - if (schemas_hash !== new_hash.digest("hex")) { + if (Object.keys(schemaJson["schemas"]).length == 0 || schemas_hash !== new_hash.digest("hex")) { console.log("hash differs"); fs.writeFileSync(HASHES_FILE, JSON.stringify(hashes), "utf8"); saveMeshrc(Object.keys(schemaJson["schemas"]), mongoURI);