From 6b25339f06270bd879c706207343e1e8848d7083 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 4 Dec 2023 14:38:40 +0100 Subject: [PATCH] 2.1.30 RC --- src/main/main.ts | 36 +++++++++++++++++++------- src/renderer/pages/CheckUpdatePage.jsx | 13 ++++------ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index 71f9f69a..4adb0efc 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -632,17 +632,35 @@ ipcMain.on('clone', async (event, branch) => { ipcMain.on('pull', async (event, branch) => { const branchGIT = branch; const backChannel = 'pull'; - const bashCommand = `API_pull "${branchGIT}"`; + let bashCommand = `cd ~/.config/EmuDeck/backend && touch ~/emudeck/logs/git.log && script ~/emudeck/logs/git.log -c 'git reset --hard && git clean -fd && git checkout ${branchGIT} && git pull' && . ~/.config/EmuDeck/backend/functions/all.sh && appImageInit`; - return exec( - `${startCommand} . ${allPath}; ${bashCommand} ${finishCommand}`, - shellType, - (error, stdout, stderr) => { - logCommand(bashCommand, error, stdout, stderr); - event.reply(backChannel, stdout); - } - ); + if (os.platform().includes('darwin')) { + bashCommand = `cd ~/.config/EmuDeck/backend && git reset --hard && git clean -fd && git checkout ${branchGIT} && git pull && . ~/.config/EmuDeck/backend/functions/all.sh && appImageInit`; + } + if (os.platform().includes('win32')) { + bashCommand = `cd %userprofile% && cd AppData && cd Roaming && cd EmuDeck && cd backend && powershell -ExecutionPolicy Bypass -command "& { Start-Transcript "$env:USERPROFILE/EmuDeck/logs/git.log"; git reset --hard ; git clean -fd ; git checkout ${branchGIT} ; git pull --allow-unrelated-histories -X theirs;cd $env:USERPROFILE ; cd AppData ; cd Roaming ; cd EmuDeck ; cd backend ; cd functions ; . ./all.ps1 ; appImageInit; Stop-Transcript; "}`; + } + + return exec(`${bashCommand}`, shellType, (error, stdout, stderr) => { + logCommand(bashCommand, error, stdout, stderr); + event.reply(backChannel, stdout); + }); }); +// Next release +// ipcMain.on('pull', async (event, branch) => { +// const branchGIT = branch; +// const backChannel = 'pull'; +// const bashCommand = `API_pull "${branchGIT}"`; +// +// return exec( +// `${startCommand} . ${allPath}; ${bashCommand} ${finishCommand}`, +// shellType, +// (error, stdout, stderr) => { +// logCommand(bashCommand, error, stdout, stderr); +// event.reply(backChannel, stdout); +// } +// ); +// }); ipcMain.on('branch', async (event) => { event.reply('branch-out', process.env.BRANCH); diff --git a/src/renderer/pages/CheckUpdatePage.jsx b/src/renderer/pages/CheckUpdatePage.jsx index 921e876e..72a29723 100644 --- a/src/renderer/pages/CheckUpdatePage.jsx +++ b/src/renderer/pages/CheckUpdatePage.jsx @@ -68,7 +68,7 @@ function CheckUpdatePage() { } }, [system]); - const showLog = () => { + const showLog = (system) => { if (system === 'win32') { ipcChannel.sendMessage('bash-nolog', [ `start powershell -NoExit -ExecutionPolicy Bypass -command "& { Get-Content $env:USERPROFILE/emudeck/logs/git.log -Tail 100 -Wait }"`, @@ -399,9 +399,9 @@ function CheckUpdatePage() { aria="Show log" disabled={false} style={{ marginBottom: 0 }} - onClick={() => showLog()} + onClick={() => showLog(system)} > - See more details + See more details {system} ), css: 'emumodal--xs emumodal--loading', @@ -432,7 +432,7 @@ function CheckUpdatePage() { }); }); } - }, [update]); + }, [update, system]); useEffect(() => { // settings here @@ -487,11 +487,8 @@ function CheckUpdatePage() { } }, [downloadComplete]); - - return ( -
- +