mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-05 23:58:50 +00:00
fix: canonicalize some steamvr related paths to hopefully resolve symlinks
This commit is contained in:
parent
e62d0ced36
commit
869927bb5c
2 changed files with 6 additions and 6 deletions
|
@ -98,7 +98,7 @@ fn get_steamvr_base_dir() -> anyhow::Result<PathBuf> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_steamvr_bin_dir_path() -> anyhow::Result<PathBuf> {
|
pub fn get_steamvr_bin_dir_path() -> anyhow::Result<PathBuf> {
|
||||||
let res = get_steamvr_base_dir()?.join("bin/linux64");
|
let res = get_steamvr_base_dir()?.join("bin/linux64").canonicalize()?;
|
||||||
if !res.is_dir() {
|
if !res.is_dir() {
|
||||||
bail!("SteamVR bin dir `{}` does not exist", res.to_string_lossy());
|
bail!("SteamVR bin dir `{}` does not exist", res.to_string_lossy());
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,9 @@ pub struct SteamLibraryFolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_steam_main_dir_path() -> anyhow::Result<PathBuf> {
|
fn get_steam_main_dir_path() -> anyhow::Result<PathBuf> {
|
||||||
let steam_root: PathBuf = get_home_dir().join(".steam/root");
|
let steam_root: PathBuf = get_home_dir().join(".steam/root").canonicalize()?;
|
||||||
|
|
||||||
if steam_root.is_symlink() {
|
if steam_root.is_dir() {
|
||||||
Ok(steam_root.read_link()?)
|
|
||||||
} else if steam_root.is_dir() {
|
|
||||||
Ok(steam_root)
|
Ok(steam_root)
|
||||||
} else {
|
} else {
|
||||||
bail!(
|
bail!(
|
||||||
|
@ -30,7 +28,9 @@ fn get_steam_main_dir_path() -> anyhow::Result<PathBuf> {
|
||||||
|
|
||||||
impl SteamLibraryFolder {
|
impl SteamLibraryFolder {
|
||||||
pub fn get_folders() -> anyhow::Result<HashMap<u32, Self>> {
|
pub fn get_folders() -> anyhow::Result<HashMap<u32, Self>> {
|
||||||
let libraryfolders_path = get_steam_main_dir_path()?.join("steamapps/libraryfolders.vdf");
|
let libraryfolders_path = get_steam_main_dir_path()?
|
||||||
|
.join("steamapps/libraryfolders.vdf")
|
||||||
|
.canonicalize()?;
|
||||||
if !libraryfolders_path.is_file() {
|
if !libraryfolders_path.is_file() {
|
||||||
bail!(
|
bail!(
|
||||||
"Steam libraryfolders.vdf does not exist in its canonical location {}",
|
"Steam libraryfolders.vdf does not exist in its canonical location {}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue