Skip to content

Commit

Permalink
some fixes and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Nov 30, 2023
1 parent bb58ce9 commit 7fac1d7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const createWindow = async () => {
preload: app.isPackaged
? path.join(__dirname, 'preload.js')
: path.join(__dirname, '../../.erb/dll/preload.js'),
nodeIntegration: false,
nodeIntegration: true,
contextIsolation: true,
},
};
Expand All @@ -220,7 +220,7 @@ const createWindow = async () => {
preload: app.isPackaged
? path.join(__dirname, 'preload.js')
: path.join(__dirname, '../../.erb/dll/preload.js'),
nodeIntegration: false,
nodeIntegration: true,
contextIsolation: true,
},
};
Expand All @@ -239,7 +239,7 @@ const createWindow = async () => {
preload: app.isPackaged
? path.join(__dirname, 'preload.js')
: path.join(__dirname, '../../.erb/dll/preload.js'),
nodeIntegration: false,
nodeIntegration: true,
contextIsolation: true,
},
};
Expand Down Expand Up @@ -437,7 +437,7 @@ ipcMain.on('getMSG', async (event) => {
if (os.platform().includes('win32')) {
bashCommand = `more %USERPROFILE%\\AppData\\Roaming\\EmuDeck\\msg.log`;
} else {
bashCommand = `cat ~/.config/EmuDeck/msg.log`;
bashCommand = `cat "$HOME/emudeck/logs/msg.log"`;
}

return exec(`${bashCommand}`, shellType, (error, stdout, stderr) => {
Expand Down Expand Up @@ -615,12 +615,12 @@ ipcMain.on('clone', async (event, branch) => {
}

const backChannel = 'clone';
let bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && script ~/.config/EmuDeck/msg.log -c 'git clone --no-single-branch --depth=1 ${repo} ~/.config/EmuDeck/backend/' && cd ~/.config/EmuDeck/backend && script ~/.config/EmuDeck/msg.log -c 'git checkout ${branchGIT}' && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;
let bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && mkdir -p ~/emudeck/logs && touch "$HOME/emudeck/logs/git.log" && script "$HOME/emudeck/logs/git.log" -c 'git clone --no-single-branch --depth=1 ${repo} ~/.config/EmuDeck/backend/' && cd ~/.config/EmuDeck/backend && script "$HOME/emudeck/logs/git.log" -c 'git checkout ${branchGIT}' && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;
if (os.platform().includes('darwin')) {
bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && git clone --no-single-branch --depth=1 ${repo} ~/.config/EmuDeck/backend/ && cd ~/.config/EmuDeck/backend && git checkout ${branchGIT} && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;
bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && mkdir -p ~/emudeck/logs && git clone --no-single-branch --depth=1 ${repo} ~/.config/EmuDeck/backend/ && cd ~/.config/EmuDeck/backend && git checkout ${branchGIT} && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;
}
if (os.platform().includes('win32')) {
bashCommand = `cd %userprofile% && cd AppData && cd Roaming && cd EmuDeck && powershell -ExecutionPolicy Bypass -command "& { mkdir "$env:USERPROFILE/EmuDeck/logs" -ErrorAction SilentlyContinue; Start-Transcript "$env:USERPROFILE/EmuDeck/logs/git-clone.log"; git clone --no-single-branch --depth=1 ${repo} ./backend; Stop-Transcript"} && cd backend && git config user.email "emudeck@emudeck.com" && git config user.name "EmuDeck" && git checkout ${branchGIT} && cd %userprofile% && if not exist emudeck mkdir emudeck && cd emudeck && CLS && echo true`;
bashCommand = `cd %userprofile% && cd AppData && cd Roaming && cd EmuDeck && powershell -ExecutionPolicy Bypass -command "& { mkdir "$env:USERPROFILE/EmuDeck/logs" -ErrorAction SilentlyContinue; Start-Transcript "$env:USERPROFILE/EmuDeck/logs/git.log"; git clone --no-single-branch --depth=1 ${repo} ./backend; Stop-Transcript"} && cd backend && git config user.email "emudeck@emudeck.com" && git config user.name "EmuDeck" && git checkout ${branchGIT} && cd %userprofile% && if not exist emudeck mkdir emudeck && cd emudeck && CLS && echo true`;
}
return exec(`${bashCommand}`, shellType, (error, stdout, stderr) => {
logCommand(bashCommand, error, stdout, stderr);
Expand All @@ -631,13 +631,13 @@ ipcMain.on('clone', async (event, branch) => {
ipcMain.on('pull', async (event, branch) => {
const branchGIT = branch;
const backChannel = 'pull';
let bashCommand = `cd ~/.config/EmuDeck/backend && script ~/EmuDeck/logs/git-pull.log -c 'git reset --hard && git clean -fd && git checkout ${branchGIT} && git pull' && . ~/.config/EmuDeck/backend/functions/all.sh && appImageInit`;
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`;

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-pull.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; "}`;
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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default function App() {
},
pegasus: {
id: 'pegasus',
status: true,
status: false,
installed: undefined,
name: 'Pegasus',
desc: 'Add this launcher to your Steam Library. Recommended for big colections',
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/pages/CheckUpdatePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ function CheckUpdatePage() {
const showLog = () => {
if (system === 'win32') {
ipcChannel.sendMessage('bash-nolog', [
`start powershell -NoExit -ExecutionPolicy Bypass -command "& { Get-Content $env:USERPROFILE/emudeck/logs/git-pull.log -Tail 100 -Wait }"`,
`start powershell -NoExit -ExecutionPolicy Bypass -command "& { Get-Content $env:USERPROFILE/emudeck/logs/git.log -Tail 100 -Wait }"`,
]);
} else if (system === 'darwin') {
ipcChannel.sendMessage('bash-nolog', [
`osascript -e 'tell app "Terminal" to do script "clear && tail -f $HOME/emudeck/logs/git-pull.log"'`,
`osascript -e 'tell app "Terminal" to do script "clear && tail -f $HOME/emudeck/logs/git.log"'`,
]);
} else {
ipcChannel.sendMessage('bash-nolog', [
`konsole -e tail -f "$HOME/emudeck/logs/git-pull.log"`,
`konsole -e tail -f "$HOME/emudeck/logs/git.log"`,
]);
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/pages/EndPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ function EndPage() {
ipcChannel.sendMessage('bash', [
`echo doInstallESDE="${installFrontends.esde.status}" >> ${settingsFile}`,
]);
ipcChannel.sendMessage('bash', [
`echo doInstallPegasus="${installFrontends.pegasus.status}" >> ${settingsFile}`,
]);
// ipcChannel.sendMessage('bash', [
// `echo doInstallPegasus="${installFrontends.pegasus.status}" >> ${settingsFile}`,
// ]);
ipcChannel.sendMessage('bash', [
`echo steamAsFrontend="${installFrontends.steam.status}" >> ${settingsFile}`,
]);
Expand Down Expand Up @@ -670,7 +670,7 @@ function EndPage() {
}

ipcChannel.sendMessage('emudeck', [
`finish|||checkForFile ~/.config/EmuDeck/.ui-finished delete && echo 'Starting...' > ~/.config/EmuDeck/msg.log && printf "\ec" && echo true`,
`finish|||checkForFile ~/.config/EmuDeck/.ui-finished delete && echo 'Starting...' > "$HOME/emudeck/logs/msg.log" && printf "\ec" && echo true`,
]);
});
ipcChannel.once('finish', (messageFinish) => {
Expand Down

0 comments on commit 7fac1d7

Please sign in to comment.