Skip to content

Commit

Permalink
Don’t write blob again if file exists already
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Feb 19, 2024
1 parent 8d30187 commit ca1f962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/build-raw-near-lake-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ async function main() {
const hash = sha256(code).toString('hex');
console.log('contract', chunk.header.height_included, change.account_id, hash);
const blobPath = `${blobDir}/${hash}.wasm`;
await writeFile(blobPath, code);
if (!await fileExists(blobPath)) {
await writeFile(blobPath, code);
}
}
}
}
Expand Down

0 comments on commit ca1f962

Please sign in to comment.