Skip to content

Commit

Permalink
flatpak: Add funny directory workaround round infinity + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Jun 2, 2024
1 parent ed1ef65 commit bdb8ca7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "re_set-lib"
version = "5.2.0"
version = "5.2.1"
edition = "2021"
description = "Data structure library for ReSet"
repository = "https://github.com/Xetibo/ReSet-Lib"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn create_config(project_name: &str) -> Option<PathBuf> {
pub fn flatpak_fix(path_buf: PathBuf) -> PathBuf {
let hacked_path = path_buf.to_str().unwrap().to_string();
if hacked_path.contains("var/app") {
PathBuf::from(hacked_path.replace("var/app/org.Xetibo.ReSet/config/reset", "config/reset"))
PathBuf::from(hacked_path.replace("var/app/org.Xetibo.ReSet/config", "config"))
} else {
path_buf
}
Expand Down
4 changes: 2 additions & 2 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ fn test_config_dir() {
fn test_flatpak_fix() {
use crate::flatpak_fix;
use std::path::PathBuf;
let flatpak = "/home/something/.var/app/org.Xetibo.ReSet/config/reset";
let flatpak = "/home/something/.var/app/org.Xetibo.ReSet/config";
assert_eq!(
flatpak_fix(PathBuf::from(flatpak)).to_str().unwrap(),
"/home/something/.config/reset"
"/home/something/.config"
);
}

Expand Down

0 comments on commit bdb8ca7

Please sign in to comment.