@overwolf/ow-electron 34.3.3-beta.0 → 34.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/checksum-validator.js +72 -0
- package/checksums.json +8 -8
- package/package.json +2 -5
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ We currently have these npm packages:
|
|
|
7
7
|
few features to it
|
|
8
8
|
- [@overwolf/ow-electron-builder](https://www.npmjs.com/package/@overwolf/ow-electron-builder) is a packaged based on electron-builder which
|
|
9
9
|
supports building ow-electron
|
|
10
|
-
- @overwolf/electron-is-overwolf - similar to
|
|
10
|
+
- [@overwolf/electron-is-overwolf](https://www.npmjs.com/package/@overwolf/electron-is-overwolf) - similar to
|
|
11
11
|
[electron-is-dev](https://www.npmjs.com/package/electron-is-dev)
|
|
12
12
|
|
|
13
13
|
There is no problem that both packages reside side-by-side with the original
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
|
|
5
|
+
function calculateFileHash(filePath) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const hash = crypto.createHash('sha256');
|
|
8
|
+
const stream = fs.createReadStream(filePath);
|
|
9
|
+
|
|
10
|
+
stream.on('error', err => reject(err));
|
|
11
|
+
stream.on('data', chunk => hash.update(chunk));
|
|
12
|
+
stream.on('end', () => resolve(hash.digest('hex')));
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function validateChecksums(folderPath) {
|
|
17
|
+
try {
|
|
18
|
+
// Read checksums.json from current directory
|
|
19
|
+
const checksumPath = path.join(process.cwd(), 'checksums.json');
|
|
20
|
+
const checksums = JSON.parse(fs.readFileSync(checksumPath, 'utf8'));
|
|
21
|
+
let hasUpdates = false;
|
|
22
|
+
|
|
23
|
+
// Check each file
|
|
24
|
+
for (const [fileName, expectedHash] of Object.entries(checksums)) {
|
|
25
|
+
const filePath = path.join(folderPath, fileName);
|
|
26
|
+
|
|
27
|
+
console.log(`\nFile: ${fileName}`);
|
|
28
|
+
console.log(`Expected hash: ${expectedHash}`);
|
|
29
|
+
|
|
30
|
+
if (fs.existsSync(filePath)) {
|
|
31
|
+
const actualHash = await calculateFileHash(filePath);
|
|
32
|
+
console.log(`Actual hash: ${actualHash}`);
|
|
33
|
+
const matches = actualHash === expectedHash;
|
|
34
|
+
console.log(`Match: ${matches}`);
|
|
35
|
+
|
|
36
|
+
// Update checksums.json if hashes don't match
|
|
37
|
+
if (!matches) {
|
|
38
|
+
console.log('Updating checksums.json with new hash...');
|
|
39
|
+
checksums[fileName] = actualHash;
|
|
40
|
+
hasUpdates = true;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
console.log('File not found in specified directory');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Write updated checksums back to file if there were any changes
|
|
48
|
+
if (hasUpdates) {
|
|
49
|
+
fs.writeFileSync(
|
|
50
|
+
checksumPath,
|
|
51
|
+
JSON.stringify(checksums, null, 2), // Pretty print with 2 spaces
|
|
52
|
+
'utf8'
|
|
53
|
+
);
|
|
54
|
+
console.log('\nChecksums.json has been updated with new hashes.');
|
|
55
|
+
} else {
|
|
56
|
+
console.log('\nNo updates were necessary.');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error('Error:', error.message);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Check if folder path is provided as command line argument
|
|
65
|
+
const folderPath = process.argv[2];
|
|
66
|
+
if (!folderPath) {
|
|
67
|
+
console.error('Please provide a folder path as an argument');
|
|
68
|
+
console.error('Usage: node checksum-validator.js <folder-path>');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
validateChecksums(folderPath);
|
package/checksums.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"electron-api.json": "437ee8f12e620f0bb3c0bc95aa4fd9c673644ccd348da8750d17c3a721e86dd0",
|
|
3
|
-
"ow-electron-v34.3.3-
|
|
4
|
-
"ow-electron-v34.3.3-
|
|
5
|
-
"ow-electron-v34.3.3-
|
|
6
|
-
"ow-electron-v34.3.3-
|
|
7
|
-
"ow-electron-v34.3.3-
|
|
8
|
-
"ow-electron-v34.3.3-
|
|
9
|
-
"ow-electron-v34.3.3-
|
|
10
|
-
"electron.d.ts": "
|
|
3
|
+
"ow-electron-v34.3.3-darwin-arm64.zip": "30d671f362fd7ecc2ef81b0f26f12606593779d9f6130ffe1d98fc08ee3f0969",
|
|
4
|
+
"ow-electron-v34.3.3-darwin-x64.zip": "2ce2ce38d85431f1e25a7aa616826206742647e640c5e31637a928f027103ba8",
|
|
5
|
+
"ow-electron-v34.3.3-linux-x64.zip": "9527cd0fc2839fcce4e136156b75d39aa2a4ba02fc48b79ad19b9a5ed2f07deb",
|
|
6
|
+
"ow-electron-v34.3.3-linux-arm64.zip": "4d563f82dcbafd4f280328294d7787177ab7fd38f1214b18280a833577c1b374",
|
|
7
|
+
"ow-electron-v34.3.3-linux-armv7l.zip": "26f50b1ef9bfb572fea3af20cdebae01112aaff69cf0933602d2c33de1a5e71a",
|
|
8
|
+
"ow-electron-v34.3.3-win32-x64.zip": "ff13bf71b2b98cf78f19497a2e6b9fce9f6b3cfa4e25210c65975a3f50a1a811",
|
|
9
|
+
"ow-electron-v34.3.3-win32-ia32.zip": "9a3741604a2e4140bdab28639f508efb2f08a449b338e40b03beb6ae0e467663",
|
|
10
|
+
"electron.d.ts": "ef32fc93b969732f26817d2ef985692ed51bd9ae9727cb9c66f8b3e26d1eb408"
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overwolf/ow-electron",
|
|
3
|
-
"version": "34.3.3
|
|
4
|
-
"owElectronVersion": "34.3.3
|
|
3
|
+
"version": "34.3.3",
|
|
4
|
+
"owElectronVersion": "34.3.3",
|
|
5
5
|
"electronVersion": "34.3.3",
|
|
6
6
|
"repository": "https://github.com/electron/electron",
|
|
7
7
|
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
|
@@ -26,8 +26,5 @@
|
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">= 10.17.0"
|
|
29
|
-
},
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"tag": "beta"
|
|
32
29
|
}
|
|
33
30
|
}
|