Skip to content

Commit

Permalink
2.1.30 RC
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Dec 4, 2023
1 parent 4bdcfac commit 6b25339
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
36 changes: 27 additions & 9 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 5 additions & 8 deletions src/renderer/pages/CheckUpdatePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }"`,
Expand Down Expand Up @@ -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}
</BtnSimple>
),
css: 'emumodal--xs emumodal--loading',
Expand Down Expand Up @@ -432,7 +432,7 @@ function CheckUpdatePage() {
});
});
}
}, [update]);
}, [update, system]);

useEffect(() => {
// settings here
Expand Down Expand Up @@ -487,11 +487,8 @@ function CheckUpdatePage() {
}
}, [downloadComplete]);



return (
<div style={{ height: '100vh' }} >

<div style={{ height: '100vh' }}>
<Wrapper css="wrapper__full" aside={false}>
<Kamek />
<Header title="EmuDeck is loading..." />
Expand Down

0 comments on commit 6b25339

Please sign in to comment.