From f3e78ef8dbf6d89999fdfe1a4022ef97c67a7514 Mon Sep 17 00:00:00 2001
From: Minteck <46352972+Minteck@users.noreply.github.com>
Date: Wed, 7 Jul 2021 22:21:32 +0200
Subject: 21.07

---
 signing/sign.js | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 signing/sign.js

(limited to 'signing')

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
-- 
cgit