mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 14:49:04 +00:00
Merge branch 'feat/noOpenvrpathsReadonlyHandling' into 'main'
feat: don't set openvrpaths as read only during profile startup See merge request gabmus/envision!124
This commit is contained in:
commit
9f4712ebe8
1 changed files with 3 additions and 3 deletions
|
@ -85,6 +85,7 @@ fn build_steam_openvrpaths() -> OpenVrPaths {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_current_openvrpaths_to_steam() -> anyhow::Result<()> {
|
pub fn set_current_openvrpaths_to_steam() -> anyhow::Result<()> {
|
||||||
|
// removing readonly flag just in case, remove this line in the future
|
||||||
set_file_readonly(&get_openvrpaths_vrpath_path(), false)?;
|
set_file_readonly(&get_openvrpaths_vrpath_path(), false)?;
|
||||||
dump_current_openvrpaths(&build_steam_openvrpaths())?;
|
dump_current_openvrpaths(&build_steam_openvrpaths())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -104,18 +105,17 @@ pub fn build_profile_openvrpaths(profile: &Profile) -> OpenVrPaths {
|
||||||
|
|
||||||
pub fn set_current_openvrpaths_to_profile(profile: &Profile) -> anyhow::Result<()> {
|
pub fn set_current_openvrpaths_to_profile(profile: &Profile) -> anyhow::Result<()> {
|
||||||
let dest = get_openvrpaths_vrpath_path();
|
let dest = get_openvrpaths_vrpath_path();
|
||||||
|
// removing readonly flag just in case, remove this line in the future
|
||||||
set_file_readonly(&dest, false)?;
|
set_file_readonly(&dest, false)?;
|
||||||
backup_steam_openvrpaths();
|
backup_steam_openvrpaths();
|
||||||
dump_current_openvrpaths(&build_profile_openvrpaths(profile))?;
|
dump_current_openvrpaths(&build_profile_openvrpaths(profile))?;
|
||||||
set_file_readonly(&dest, true)?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
use super::{dump_openvrpaths_to_path, get_openvrpaths_from_path, OpenVrPaths};
|
use super::{dump_openvrpaths_to_path, get_openvrpaths_from_path, OpenVrPaths};
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_read_openvrpaths_vrpath_steamvr() {
|
fn can_read_openvrpaths_vrpath_steamvr() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue