mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
@@ -35,19 +35,14 @@ addAllFiles(path.resolve(__dirname, '../patches'));
|
|||||||
|
|
||||||
// Create Hash
|
// Create Hash
|
||||||
const hasher = crypto.createHash('SHA256');
|
const hasher = crypto.createHash('SHA256');
|
||||||
const addToHashAndLog = (s) => {
|
hasher.update(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`);
|
||||||
console.log('Hashing:', s);
|
|
||||||
return hasher.update(s);
|
|
||||||
};
|
|
||||||
addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`);
|
|
||||||
for (const file of filesToHash) {
|
for (const file of filesToHash) {
|
||||||
console.log('Hashing Content:', file, crypto.createHash('SHA256').update(fs.readFileSync(file)).digest('hex'));
|
|
||||||
hasher.update(fs.readFileSync(file));
|
hasher.update(fs.readFileSync(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the GCLIENT_EXTRA_ARGS variable to the hash
|
// Add the GCLIENT_EXTRA_ARGS variable to the hash
|
||||||
const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args';
|
const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args';
|
||||||
addToHashAndLog(extraArgs);
|
hasher.update(extraArgs);
|
||||||
|
|
||||||
const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform;
|
const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user