Fix paths

Replaced backslashes in paths with slashes. I did
not touch function that do the same with paths.
Those can be removed manually.
Also dataDir() returns a path that ends with a
slash so I got rid of duplicated slashes.
This commit is contained in:
fnrir
2023-06-24 14:09:22 +02:00
parent 882bad370f
commit 3ba467d03b
11 changed files with 38 additions and 38 deletions

View File

@@ -118,7 +118,7 @@ async function readConfigFile() {
await fs.createDir(local + 'cultivation').catch((e) => console.log(e))
}
const innerDirs = await fs.readDir(local + '/cultivation')
const innerDirs = await fs.readDir(local + 'cultivation')
// Create grasscutter dir for potential installation
if (!innerDirs.find((fileOrDir) => fileOrDir?.name === 'grasscutter')) {

View File

@@ -45,7 +45,7 @@ export async function getGameDataFolder() {
return null
}
return (await getGameFolder()) + '\\' + gameExec.replace('.exe', '_Data')
return (await getGameFolder()) + '/' + gameExec.replace('.exe', '_Data')
}
export async function getGameVersion() {
@@ -57,7 +57,7 @@ export async function getGameVersion() {
const settings = JSON.parse(
await invoke('read_file', {
path: GameData + '\\StreamingAssets\\asb_settings.json',
path: GameData + '/StreamingAssets/asb_settings.json',
})
)

View File

@@ -3,11 +3,11 @@ import { getGameFolder } from './game'
// Patch file from: https://github.com/34736384/RSAPatch/
export async function patchGame() {
const patchPath = (await invoke('install_location')) + '\\patch\\version.dll'
const patchPath = (await invoke('install_location')) + '/patch/version.dll'
// Are we already patched with mhypbase? If so, that's fine, just continue as normal
const gameIsPatched = await invoke('are_files_identical', {
path1: patchPath,
path2: (await getGameRSAPath()) + '\\mhypbase.dll',
path2: (await getGameRSAPath()) + '/mhypbase.dll',
})
// Tell user they won't be unpatched with manual mhypbase patch
@@ -33,7 +33,7 @@ export async function patchGame() {
export async function unpatchGame() {
// Just delete patch since it's not replacing any existing file
const deleted = await invoke('delete_file', {
path: (await getGameRSAPath()) + '\\version.dll',
path: (await getGameRSAPath()) + '/version.dll',
})
return deleted

View File

@@ -40,7 +40,7 @@ const defaultTheme = {
export async function getThemeList() {
// Do some invoke to backend to get the theme list
const themes = (await invoke('get_theme_list', {
dataDir: `${await dataDir()}/cultivation`,
dataDir: `${await dataDir()}cultivation`,
})) as BackendThemeList[]
const list: ThemeList[] = [
// ALWAYS include default theme