Skip to content

Commit

Permalink
Merge branch 'dev' into early-unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Sep 13, 2024
2 parents 0059de9 + 34f3b02 commit 7fafa19
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 8 deletions.
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EmuDeck",
"version": "2.3.0",
"version": "2.4.0",
"description": "Play all your RetroGames",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/data/local-fake-os.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"fakeOS": "SteamOS"
"fakeOS": "darwin"
}
17 changes: 13 additions & 4 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,13 @@ ipcMain.on('emudeck', async (event, command) => {
// file exists
} else {
event.reply(backChannel, 'nogit');
let bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && git clone --no-single-branch --depth=1 https://github.com/dragoonDorise/EmuDeck.git ~/.config/EmuDeck/backend/ && cd ~/.config/EmuDeck/backend && git checkout master && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;

let bashCommand;
if (os.platform().includes('win32')) {
bashCommand = `cd %userprofile% && cd AppData && cd Roaming && cd EmuDeck && powershell -ExecutionPolicy Bypass -command "& { Start-Transcript "$env:USERPROFILE/EmuDeck/logs/pull.log"; git clone --no-single-branch --depth=1 https://github.com/EmuDeck/emudeck-we.git ./backend; Stop-Transcript"} && cd backend && git config user.email "[email protected]" && git config user.name "EmuDeck" && git checkout master && cd %userprofile% && if not exist emudeck mkdir emudeck && cd emudeck && CLS && echo true`;
} else if (os.platform().includes('darwin')) {
bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && git clone --no-single-branch --depth=1 https://github.com/EmuDeck/emudeck-darwin.git ~/.config/EmuDeck/backend/ && cd ~/.config/EmuDeck/backend && git checkout master && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;
} else {
bashCommand = `rm -rf ~/.config/EmuDeck/backend && mkdir -p ~/.config/EmuDeck/backend && git clone --no-single-branch --depth=1 https://github.com/dragoonDorise/EmuDeck.git ~/.config/EmuDeck/backend/ && cd ~/.config/EmuDeck/backend && git checkout master && touch ~/.config/EmuDeck/.cloned && printf "ec" && echo true`;
}

return exec(`${bashCommand}`, shellType, (error, stdout, stderr) => {
Expand Down Expand Up @@ -683,15 +686,21 @@ ipcMain.on('check-git', async (event) => {

ipcMain.on('clone', async (event, branch) => {
const branchGIT = branch;
let repo = 'https://github.com/dragoonDorise/EmuDeck.git';
let repo;
if (os.platform().includes('win32')) {
repo = 'https://github.com/EmuDeck/emudeck-we.git';
} else if (os.platform().includes('darwin')) {
repo = 'https://github.com/EmuDeck/emudeck-darwin.git';
} else {
repo = 'https://github.com/dragoonDorise/EmuDeck.git';
}

const backChannel = 'clone';
let 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`;
let bashCommand;
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.log"; git clone --no-single-branch --depth=1 ${repo} ./backend; Stop-Transcript"} && cd backend && git config user.email "[email protected]" && git config user.name "EmuDeck" && git checkout ${branchGIT} && cd %userprofile% && if not exist emudeck mkdir emudeck && cd emudeck && CLS && echo true`;
} else {
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`;
}
return exec(`${bashCommand}`, shellType, (error, stdout, stderr) => {
logCommand(bashCommand, error, stdout, stderr);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components
50 changes: 49 additions & 1 deletion src/renderer/pages/PatroenLoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function PatreonLoginPage() {
achievements,
shader,
patreonToken,
patreonStatus,
} = state;

//
Expand Down Expand Up @@ -118,6 +119,7 @@ function PatreonLoginPage() {
.then((data) => {
const patreonJson = data;

console.log({ patreonJson });
if (patreonJson.error) {
setStatePage({
...statePage,
Expand All @@ -143,6 +145,45 @@ function PatreonLoginPage() {
patreonTokenTemp: patreonJson.new_token,
accessAllowed: true,
});
} else {
const settingsStorage = JSON.parse(
localStorage.getItem('settings_emudeck')
);
const shadersStored = settingsStorage.shaders;
const overwriteConfigEmusStored = settingsStorage.overwriteConfigEmus;
const achievementsStored = settingsStorage.achievements;

delete settingsStorage.installEmus.primehacks;
delete settingsStorage.installEmus.cemunative;
delete settingsStorage.overwriteConfigEmus.primehacks;
const installEmusStored = settingsStorage.installEmus;

// Theres probably a better way to do this...

ipcChannel.sendMessage('version');

ipcChannel.once('version-out', (version) => {
ipcChannel.sendMessage('system-info-in');
ipcChannel.once('system-info-out', (platform) => {
console.log({
system: platform,
version: version[0],
gamemode: version[1],
});
alert(
"No patreon detected, you can use EmuDeck but you won't get new updates"
);
setState({
...state,
patreonStatus: null,
//...settingsStorage,
system: platform,
// version: version[0],
second: true,
branch: 'early',
});
});
});
}
})
.catch((error) => {
Expand All @@ -157,6 +198,12 @@ function PatreonLoginPage() {
//
// UseEffects
//
useEffect(() => {
if (patreonStatus === null) {
//navigate('/emulators');
console.log({ patreonStatus });
}
}, [patreonStatus]);
useEffect(() => {
const patreonTokenLS = localStorage.getItem('patreon_token');
if (!branch.includes('early')) {
Expand Down Expand Up @@ -212,6 +259,7 @@ function PatreonLoginPage() {
});
setState({
...state,
patreonStatus: true,
...settingsStorage,
installEmus: { ...installEmus, ...installEmusStored },
overwriteConfigEmus: {
Expand Down Expand Up @@ -269,7 +317,7 @@ function PatreonLoginPage() {
onClick={() => patreonShowInput()}
disabled={accessAllowed}
>
{t('PatroenLoginPage.login')}{' '}
{accessAllowed || t('PatroenLoginPage.login')}{' '}
{accessAllowed && `- ${t('general.loading')}`}
</BtnSimple>
<BtnSimple
Expand Down

0 comments on commit 7fafa19

Please sign in to comment.