fix funky paths

This commit is contained in:
SpikeHD
2022-07-13 18:19:55 -07:00
parent fd87adc1f6
commit 375e15e947
2 changed files with 21 additions and 5 deletions

View File

@@ -8,5 +8,20 @@ export async function getGameExecutable() {
}
const pathArr = config.game_install_path.replace(/\\/g, '/').split('/')
return pathArr[pathArr.length - 1].replace('.exe', '')
return pathArr[pathArr.length - 1]
}
export async function getGameFolder() {
const config = await getConfig()
if(!config.game_install_path) {
return null
}
const pathArr = config.game_install_path.replace(/\\/g, '/').split('/')
pathArr.pop()
const path = pathArr.join('/')
return path
}