fix: create openxr config dir when starting profile

This commit is contained in:
Gabriele Musco 2024-12-05 07:09:00 +01:00
commit 4905c8fed1

View file

@ -7,7 +7,7 @@ use crate::{
use anyhow::bail; use anyhow::bail;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{ use std::{
fs::{remove_file, rename}, fs::{create_dir_all, remove_file, rename},
os::unix::fs::symlink, os::unix::fs::symlink,
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
@ -112,6 +112,7 @@ pub fn set_current_active_runtime_to_profile(profile: &Profile) -> anyhow::Resul
let profile_openxr_json = profile.openxr_json_path(); let profile_openxr_json = profile.openxr_json_path();
if profile_openxr_json.is_file() { if profile_openxr_json.is_file() {
create_dir_all(dest.parent().unwrap())?;
symlink(profile_openxr_json, &dest)?; symlink(profile_openxr_json, &dest)?;
} else { } else {
warn!("profile openxr json file doesn't exist"); warn!("profile openxr json file doesn't exist");