Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added --force-next-version command line param. #1019

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ const generateSHA256HashOfFile = (file) => {
return generateSHA256Hash(fs.readFileSync(file))
}

const generateVersionedSHA256HashOfFile = (file, version) => {
return generateSHA256Hash(version + fs.readFileSync(file))
}

const getIDFromBase64PublicKey = (key) => {
const hash = crypto.createHash('sha256')
const data = Buffer.from(key, 'base64')
Expand Down Expand Up @@ -676,6 +680,7 @@ export default {
generateCRXFile,
generatePuffPatches,
generateSHA256HashOfFile,
generateVersionedSHA256HashOfFile,
getNextVersion,
getIDFromBase64PublicKey,
installErrorHandlers,
Expand Down
5 changes: 4 additions & 1 deletion scripts/packageAdBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ const processComponent = (

let contentHash
if (fileToHash !== undefined) {
// Increase this number if you want to recreate adblock components,
// even if the hash of the content file has not changed.
const contentHashVersion = 1
const contentFile = path.join('build', 'ad-block-updater', componentSubdir, fileToHash)
contentHash = util.generateSHA256HashOfFile(contentFile)
contentHash = util.generateVersionedSHA256HashOfFile(contentFile, contentHashVersion)
}

if (!localRun) {
Expand Down
Loading