Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Oct 25, 2023
1 parent d9282e3 commit 322b0ef
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 27 deletions.
12 changes: 11 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,16 +1097,26 @@ ipcMain.on('run-app', async (event, appPath) => {
if (appPathFixed.includes('USERPATH')) {
appPathFixed = appPathFixed.replace('USERPATH', userFolder);
}
if (!appPathFixed.includes('"')) {
appPathFixed = `"${appPathFixed}"`;
}

let externalApp;
if (os.platform().includes('win32')) {
externalApp = spawn(appPathFixed);
} else if (os.platform().includes('darwin')) {
externalApp = spawn('open', [appPathFixed]);
} else {
externalApp = spawn('xdg-open', [appPathFixed]);
return exec(`${appPathFixed}`, shellType, (error, stdout, stderr) => {
// event.reply('console', { backChannel });
logCommand(appPathFixed, error, stdout, stderr);
event.reply('run-app', 'launched');
});
// externalApp = spawn('xdg-open', [appPathFixed]);
}

fs.writeFileSync(`${os.homedir()}/emudeck/logs/run-app.log`, appPathFixed);

externalApp.on('error', (err: any) => {
event.reply('run-app', err);
});
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components
37 changes: 19 additions & 18 deletions src/renderer/pages/EmulatorsDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function EmulatorsDetailPage() {
});

ipcChannel.sendMessage('emudeck', [
`YuzuEA_addToken|||YuzuEA_addToken ${yuzuEAtoken}`,
`YuzuEA_addToken|||YuzuEA_addToken "${yuzuEAtoken}"`,
]);
let modalHeader;
let modalBody;
Expand Down Expand Up @@ -808,27 +808,28 @@ function EmulatorsDetailPage() {
]);

ipcChannel.once(`${code}_IsInstalled`, (message) => {
console.log({ message });
status = message.stdout;
status.replace('\n', '');

if (status.includes('true')) {
// const modalData = {
// active: true,
// header: <span className="h4">{code} installed!</span>,
// body: (
// <p>
// {code} has been installed, now you can play games from {code}{' '}
// using EmulationStation-DE or adding them to your Steam Library
// using Steam Rom Manager
// </p>
// ),
// css: 'emumodal--xs',
// };
//
// setStatePage({
// ...statePage,
// modal: modalData,
// });
const modalData = {
active: true,
header: <span className="h4">{code} installed!</span>,
body: (
<p>
{code} has been installed, now you can play games from {code}{' '}
using EmulationStation-DE or adding them to your Steam Library
using Steam Rom Manager
</p>
),
css: 'emumodal--xs',
};

setStatePage({
...statePage,
modal: modalData,
});
// We set the emu as install = yes
setState({
...state,
Expand Down
43 changes: 36 additions & 7 deletions src/renderer/pages/WelcomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ function WelcomePage() {
};
setStatePage({ ...statePage, modal: modalData });
ipcChannel.sendMessage('bash', [`kill -15 $(pidof steam)`]);
console.log(
`"${storagePath}/Emulation/tools/Steam ROM Manager.AppImage"`
);
ipcChannel.sendMessage(
'run-app',
`"${storagePath}/Emulation/tools/Steam ROM Manager.AppImage"`
`${storagePath}/Emulation/tools/Steam ROM Manager.AppImage`
);
}
ipcChannel.once('run-app', (message) => {
Expand Down Expand Up @@ -254,12 +257,38 @@ function WelcomePage() {
});
};

const sprunge = () => {
ipcChannel.sendMessage('bash', [
`sprunge|||cat ~/emudeck/emudeck.log | curl -F 'sprunge=<-' http://sprunge.us`,
]);
ipcChannel.once('sprunge', (message) => {
prompt('Copy this url:', `${message}`);
const getLogs = () => {
ipcChannel.sendMessage('emudeck', [`zipLogs|||zipLogs`]);
ipcChannel.once('zipLogs', (message) => {
console.log({ message });
let modalData;
let { stdout } = message;

stdout = stdout.replace('\n', '');

if (stdout.includes('true')) {
modalData = {
active: true,
header: <span className="h4">Success!</span>,
body: (
<p>We've created a Zip file with all your logs on your Desktop</p>
),
css: 'emumodal--xs',
};
} else {
modalData = {
active: true,
header: <span className="h4">Error!</span>,
body: (
<p>
There was an issue getting your logs, please collect them manually
from the emudeck folder in your user folder.
</p>
),
css: 'emumodal--xs',
};
}
setStatePage({ ...statePage, modal: modalData });
});
};

Expand Down

0 comments on commit 322b0ef

Please sign in to comment.