From ca0f4a14636d123d4880da5786f43c75abab8d1d Mon Sep 17 00:00:00 2001 From: Nikhil Narayana Date: Thu, 10 Aug 2023 00:10:43 -0700 Subject: [PATCH] refactor: remove old user folder stuff for mac --- src/dolphin/install/installation.ts | 7 ------- src/dolphin/install/macos.ts | 23 ----------------------- 2 files changed, 30 deletions(-) diff --git a/src/dolphin/install/installation.ts b/src/dolphin/install/installation.ts index 510d0011c..e3180b848 100644 --- a/src/dolphin/install/installation.ts +++ b/src/dolphin/install/installation.ts @@ -238,16 +238,9 @@ export class DolphinInstallation { } case "darwin": { const { installDolphinOnMac } = await import("./macos"); - const currentVersion = await this.getDolphinVersion(); - const userFolderInBundle = currentVersion !== null && lt(currentVersion, "3.0.5"); - if (userFolderInBundle) { - const oldUserFolder = path.join(dolphinPath, "Slippi Dolphin.app", "Contents", "Resources", "User"); - await fs.copy(oldUserFolder, this.userFolder, { recursive: true, overwrite: true }); - } await installDolphinOnMac({ assetPath, destinationFolder: dolphinPath, - shouldBackupUserFolder: userFolderInBundle, }); break; } diff --git a/src/dolphin/install/macos.ts b/src/dolphin/install/macos.ts index b8a93b8ae..e39bb9a74 100644 --- a/src/dolphin/install/macos.ts +++ b/src/dolphin/install/macos.ts @@ -7,23 +7,12 @@ import { extractDmg } from "./extractDmg"; export async function installDolphinOnMac({ assetPath, destinationFolder, - shouldBackupUserFolder, log = console.log, }: { assetPath: string; destinationFolder: string; - shouldBackupUserFolder?: boolean; log?: (message: string) => void; }) { - const backupLocation = destinationFolder + "_old"; - const dolphinResourcesPath = path.join(destinationFolder, "Slippi Dolphin.app", "Contents", "Resources"); - - const backupUserFolder = shouldBackupUserFolder && (await fs.pathExists(dolphinResourcesPath)); - if (backupUserFolder) { - log(`${dolphinResourcesPath} already exists. Moving...`); - await fs.move(destinationFolder, backupLocation, { overwrite: true }); - } - log(`Extracting to: ${destinationFolder}`); await extractDmg(assetPath, destinationFolder); const files = await fs.readdir(destinationFolder); @@ -42,16 +31,4 @@ export async function installDolphinOnMac({ await fs.chown(path.join(destinationFolder, "Slippi Dolphin.app"), userInfo.uid, userInfo.gid); await fs.chmod(binaryLocation, "777"); await fs.chown(binaryLocation, userInfo.uid, userInfo.gid); - - // move backed up User folder and user.json - if (backupUserFolder) { - const oldUserFolder = path.join(backupLocation, "Slippi Dolphin.app", "Contents", "Resources", "User"); - const newUserFolder = path.join(dolphinResourcesPath, "User"); - log("moving User folder..."); - const hasUserFolder = await fs.pathExists(oldUserFolder); - if (hasUserFolder) { - await fs.move(oldUserFolder, newUserFolder); - } - await fs.remove(backupLocation); - } }