From 8168c69da3ab02b24558ed08d08b7687bb3f873f Mon Sep 17 00:00:00 2001 From: Yeon Vinzenz Varapragasam Date: Mon, 8 Jan 2024 16:11:43 +0100 Subject: [PATCH] Prepare Linux CC --- public/electron.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/electron.js b/public/electron.js index e99c816d..5ffb0d0c 100644 --- a/public/electron.js +++ b/public/electron.js @@ -175,7 +175,9 @@ const ready = () => ( const integratedCore = (process.platform === 'darwin') ? fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx_core.app')) - : fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx.exe')) + : (process.platform === 'linux') + ? fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx')) + : fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx.exe')) const currentDir = fs.readdirSync(thePath) console.log(currentDir) @@ -183,6 +185,8 @@ const ready = () => ( if (integratedCore) { if (process.platform === 'darwin') { subpy = require('child_process').spawn(`${path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx_core.app/Contents/MacOS/LedFx_v2')}`, []); + } else if (process.platform === 'linux') { + subpy = require('child_process').spawn(`${path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx')}`, ['-p', '8888', '--no-tray']); } else { subpy = require('child_process').spawn(`${path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx.exe')}`, ['-p', '8888', '--no-tray']); } @@ -347,6 +351,9 @@ const ready = () => ( if (process.platform === 'darwin') { wind.webContents.send('fromMain', ['currentdir', integratedCore, fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx_core.app'))]); subpy = require('child_process').spawn(`${path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx_core.app/Contents/MacOS/LedFx_v2')}`, []); + } else if (process.platform === 'linux') { + wind.webContents.send('fromMain', ['currentdir', integratedCore, fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx'))]); + subpy = require('child_process').spawn(`${path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx')}`, ['-p', '8888', '--no-tray']); } else { wind.webContents.send('fromMain', ['currentdir', integratedCore, fs.existsSync(path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx.exe'))]); subpy = require('child_process').spawn(`${path.join(path.dirname(__dirname), isDev ? 'extraResources' : '../extraResources','LedFx/LedFx.exe')}`, []);