From 7580650ccc9a9239297ab16837550776f480021b Mon Sep 17 00:00:00 2001 From: Kylie C Date: Fri, 20 Dec 2024 16:40:18 -0500 Subject: [PATCH] update arrpc patch for runtime database --- patches/arrpc@3.5.0.patch | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/patches/arrpc@3.5.0.patch b/patches/arrpc@3.5.0.patch index 8dfd9f64..0c88ea34 100644 --- a/patches/arrpc@3.5.0.patch +++ b/patches/arrpc@3.5.0.patch @@ -1,14 +1,19 @@ diff --git a/src/process/index.js b/src/process/index.js -index 97ea6514b54dd9c5df588c78f0397d31ab5f882a..c2bdbd6aaa5611bc6ff1d993beeb380b1f5ec575 100644 +index 04b3898..a2e1031 100644 --- a/src/process/index.js +++ b/src/process/index.js -@@ -5,8 +5,7 @@ import fs from 'node:fs'; - import { dirname, join } from 'path'; - import { fileURLToPath } from 'url'; +@@ -2,12 +2,10 @@ const rgb = (r, g, b, msg) => `\x1b[38;2;${r};${g};${b}m${msg}\x1b[0m`; + const log = (...args) => console.log(`[${rgb(88, 101, 242, 'arRPC')} > ${rgb(237, 66, 69, 'process')}]`, ...args); + + import fs from 'node:fs'; +-import { dirname, join } from 'path'; +-import { fileURLToPath } from 'url'; + import { get } from 'https'; -const __dirname = dirname(fileURLToPath(import.meta.url)); --const DetectableDB = JSON.parse(fs.readFileSync(join(__dirname, 'detectable.json'), 'utf8')); -+const DetectableDB = require('./detectable.json'); +-const databasePath = join(__dirname, 'detectable.json'); ++import { app } from 'electron'; ++const databasePath = join(app.getPath('userData'), 'detectable.json'); - import * as Natives from './native/index.js'; - const Native = Natives[process.platform]; + async function getDatabase() { + return new Promise((resolve, reject) => { \ No newline at end of file