1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-21 04:07:46 +00:00

Oops, these paths are not supposed to be absolute

This commit is contained in:
Joshua Goins 2024-05-26 07:56:20 -04:00
parent 0c105ab089
commit c1dd406be4

View file

@ -40,23 +40,23 @@ pub fn find_existing_game_dirs() -> Vec<ExistingGameDirectory> {
// Official install (Wine) // Official install (Wine)
install_dirs.push(ExistingGameDirectory { install_dirs.push(ExistingGameDirectory {
install_type: ExistingInstallType::OfficialLauncher, install_type: ExistingInstallType::OfficialLauncher,
path: from_home_dir("/.wine/drive_c/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn") path: from_home_dir(".wine/drive_c/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn")
}); });
// Official install (Steam) // Official install (Steam)
install_dirs.push(ExistingGameDirectory { install_dirs.push(ExistingGameDirectory {
install_type: ExistingInstallType::OfficialLauncher, install_type: ExistingInstallType::OfficialLauncher,
path: from_home_dir("/.steam/steam/steamapps/common/FINAL FANTASY XIV - A Realm Reborn") path: from_home_dir(".steam/steam/steamapps/common/FINAL FANTASY XIV - A Realm Reborn")
}); });
// XIVLauncherCore location // XIVLauncherCore location
install_dirs.push(ExistingGameDirectory { install_dirs.push(ExistingGameDirectory {
install_type: ExistingInstallType::XIVLauncherCore, install_type: ExistingInstallType::XIVLauncherCore,
path: from_home_dir("/.xlcore/ffxiv") path: from_home_dir(".xlcore/ffxiv")
}); });
// Astra location. But we have to iterate through each UUID. // Astra location. But we have to iterate through each UUID.
if let Ok(entries) = read_dir(from_home_dir("/.local/share/astra/game/")) { if let Ok(entries) = read_dir(from_home_dir(".local/share/astra/game/")) {
entries entries
.flatten() .flatten()
.flat_map(|entry| { .flat_map(|entry| {
@ -80,7 +80,7 @@ pub fn find_existing_game_dirs() -> Vec<ExistingGameDirectory> {
// Official Launcher (macOS) // Official Launcher (macOS)
install_dirs.push(ExistingGameDirectory { install_dirs.push(ExistingGameDirectory {
install_type: ExistingInstallType::OfficialLauncher, install_type: ExistingInstallType::OfficialLauncher,
path: from_home_dir("/Library/Application Support/FINAL FANTASY XIV ONLINE/Bottles/published_Final_Fantasy/drive_c/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn") path: from_home_dir("Library/Application Support/FINAL FANTASY XIV ONLINE/Bottles/published_Final_Fantasy/drive_c/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn")
}); });
// TODO: add XIV on Mac // TODO: add XIV on Mac
@ -120,17 +120,17 @@ pub fn find_existing_user_dirs() -> Vec<ExistingUserDirectory> {
// Official install (Wine) // Official install (Wine)
user_dirs.push(ExistingUserDirectory { user_dirs.push(ExistingUserDirectory {
install_type: ExistingInstallType::OfficialLauncher, install_type: ExistingInstallType::OfficialLauncher,
path: from_home_dir("/Documents/My Games/FINAL FANTASY XIV - A Realm Reborn") path: from_home_dir("Documents/My Games/FINAL FANTASY XIV - A Realm Reborn")
}); });
// XIVLauncherCore location // XIVLauncherCore location
user_dirs.push(ExistingUserDirectory { user_dirs.push(ExistingUserDirectory {
install_type: ExistingInstallType::XIVLauncherCore, install_type: ExistingInstallType::XIVLauncherCore,
path: from_home_dir("/.xlcore/ffxivConfig") path: from_home_dir(".xlcore/ffxivConfig")
}); });
// Astra location. But we have to iterate through each UUID. // Astra location. But we have to iterate through each UUID.
if let Ok(entries) = read_dir(from_home_dir("/.local/share/astra/user/")) { if let Ok(entries) = read_dir(from_home_dir(".local/share/astra/user/")) {
entries entries
.flatten() .flatten()
.flat_map(|entry| { .flat_map(|entry| {
@ -154,7 +154,7 @@ pub fn find_existing_user_dirs() -> Vec<ExistingUserDirectory> {
// Official install (Wine) // Official install (Wine)
user_dirs.push(ExistingUserDirectory { user_dirs.push(ExistingUserDirectory {
install_type: ExistingInstallType::OfficialLauncher, install_type: ExistingInstallType::OfficialLauncher,
path: from_home_dir("/Documents/My Games/FINAL FANTASY XIV - A Realm Reborn") path: from_home_dir("Documents/My Games/FINAL FANTASY XIV - A Realm Reborn")
}) })
// TODO: Add XIV on Mac? // TODO: Add XIV on Mac?
@ -163,7 +163,7 @@ pub fn find_existing_user_dirs() -> Vec<ExistingUserDirectory> {
// Official install // Official install
user_dirs.push(ExistingUserDirectory { user_dirs.push(ExistingUserDirectory {
install_type: ExistingInstallType::OfficialLauncher, install_type: ExistingInstallType::OfficialLauncher,
path: from_home_dir("/Documents/My Games/FINAL FANTASY XIV - A Realm Reborn") path: from_home_dir("Documents/My Games/FINAL FANTASY XIV - A Realm Reborn")
}) })
// TODO: Add Astra // TODO: Add Astra
@ -176,7 +176,7 @@ pub fn find_existing_user_dirs() -> Vec<ExistingUserDirectory> {
fn from_home_dir(path: &'static str) -> String { fn from_home_dir(path: &'static str) -> String {
let mut new_path = home_dir().unwrap(); let mut new_path = home_dir().unwrap();
new_path.extend([path]); new_path.push(path);
return new_path.into_os_string().into_string().unwrap(); return new_path.into_os_string().into_string().unwrap();
} }