Skip to content

Commit

Permalink
fix(): call .hash of calculateFileHashResults in requireUpdate compar…
Browse files Browse the repository at this point in the history
…ison to compare the hash values
  • Loading branch information
agerbig committed Oct 28, 2021
1 parent 8107d53 commit 2af7afe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build/check-for-font-updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ const path = require('path');

async function main() {
let fontJsonFilePath = path.join(common.DIST_DIR_PATH, 'fonts', 'MaterialIcons-Regular.json');
let hashPreUpdate = await common.calculateFileHash(fontJsonFilePath).hash;
let hashPreUpdate = await common.calculateFileHash(fontJsonFilePath);
await common.updateAndBuild();
let hashPostUpdate = await common.calculateFileHash(fontJsonFilePath).hash;
let hashPostUpdate = await common.calculateFileHash(fontJsonFilePath);

let requireUpdate = hashPreUpdate !== hashPostUpdate;
let requireUpdate = hashPreUpdate.hash !== hashPostUpdate.hash;
if (!requireUpdate) {
throw new Error("nothing to update")
}
console.log(`an update is required ${hashPreUpdate} != ${hashPostUpdate}`);
console.log(`an update is required ${hashPreUpdate.hash} != ${hashPostUpdate.hash}`);
}


Expand Down

1 comment on commit 2af7afe

@agerbig
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add the issue number on commit.

#78

Please # to comment.