aboutsummaryrefslogtreecommitdiff
path: root/signing
diff options
context:
space:
mode:
Diffstat (limited to 'signing')
-rw-r--r--signing/sign.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/signing/sign.js b/signing/sign.js
new file mode 100644
index 0000000..116a6a9
--- /dev/null
+++ b/signing/sign.js
@@ -0,0 +1,23 @@
+const fs = require('fs');
+const crypto = require('crypto');
+global.sdb = {};
+
+function scan(start) {
+ rt = fs.readdirSync(start);
+ for (file of rt) {
+ if (file !== ".git" && file !== "build" && file !== "signatures.json" && file !== "staging" && file !== "node_modules" && !file.endsWith(".staging") && !file.endsWith(".old") && file !== "_translate") {
+ if (fs.lstatSync(start + "/" + file).isDirectory()) {
+ scan(start + "/" + file);
+ } else {
+ sign = crypto.createHash('sha512').update(fs.readFileSync(start + "/" + file)).digest('base64')
+ console.log("Signed: " + start + "/" + file + ": " + sign);
+ sdb[(start + "/" + file).substr(1)] = sign;
+ }
+ }
+ }
+}
+
+scan("..");
+scan("../node_modules/electron");
+scan("../node_modules/@electron");
+fs.writeFileSync("../bin/signatures.json", JSON.stringify(sdb)); \ No newline at end of file