fix: appimage webui path

feat/type-attributes
Tomáš Mládek 2023-08-24 19:55:35 +02:00
parent 3f9ce3991c
commit d5f2d3c701
1 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,5 @@
use std::env::current_exe;
use anyhow::{anyhow, Result};
use lazy_static::lazy_static;
use shadow_rs::{is_debug, shadow};
@ -9,7 +11,10 @@ pub fn get_resource_path<S: AsRef<str>>(dir: S) -> Result<std::path::PathBuf> {
let cwd = std::env::current_exe()?.parent().unwrap().to_path_buf();
cwd.join("../../tmp/resources")
} else {
"/usr/share/upend".into()
current_exe()?
.parent()
.ok_or(anyhow!("couldn't locate resource path, binary in root"))?
.join("../share/upend")
};
let result = base_path.join(dir.as_ref());