aboutsummaryrefslogtreecommitdiffstats
path: root/electron-builder-fix-env.js
diff options
context:
space:
mode:
authorLibravatar Balaji Vijayakumar <kuttibalaji.v6@gmail.com>2023-01-02 10:35:46 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2023-01-02 13:11:48 +0530
commit88e6c0047ed4ff99638ff5844c76cbe2399cffde (patch)
tree1139f6b953597939b9a5d1b05c13fc8dabcfecd5 /electron-builder-fix-env.js
parent6.2.4-nightly.2 [skip ci] (diff)
downloadferdium-app-88e6c0047ed4ff99638ff5844c76cbe2399cffde.tar.gz
ferdium-app-88e6c0047ed4ff99638ff5844c76cbe2399cffde.tar.zst
ferdium-app-88e6c0047ed4ff99638ff5844c76cbe2399cffde.zip
fix: update pnpm and revert to stable electron-builder
Diffstat (limited to 'electron-builder-fix-env.js')
-rw-r--r--electron-builder-fix-env.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/electron-builder-fix-env.js b/electron-builder-fix-env.js
deleted file mode 100644
index 39c5f142c..000000000
--- a/electron-builder-fix-env.js
+++ /dev/null
@@ -1,28 +0,0 @@
1const fs = require("fs");
2const path = require("path");
3exports.default = async function (context) {
4 // HACKTAG: Fix to overcome https://github.com/electron-userland/electron-builder/issues/7256 from electron-builder for windows multi-arch builds
5 delete process.env.GYP_MSVS_VERSION;
6
7 // CRAZY HACKTAG: Fix to overcome https://github.com/electron/rebuild/issues/546 from electron-rebuild
8 /*
9 1. Finds sqlite3/package.json
10 2. replaces napi_build_version with 6 //current used one
11 3. removes napi_versions (if present it expected napi_build_version to be present in modulePath)
12 */
13 const filePath = path.join(process.cwd(), "build", "node_modules", "sqlite3", "package.json");
14
15 //This is to enfore that it happens only during rebuild.
16 if(fs.existsSync(filePath)) {
17 const sqlLite = require(filePath);
18 Object.keys(sqlLite.binary).forEach(key => {
19 let value = sqlLite.binary[key];
20 if(typeof value === 'string') {
21 value = value.replace("{napi_build_version}", 6)
22 sqlLite.binary[key] = value
23 }
24 })
25 delete sqlLite.binary["napi_versions"]
26 fs.writeFileSync(filePath, JSON.stringify(sqlLite))
27 }
28};