mirror of
https://github.com/denisidoro/navi
synced 2024-11-29 06:50:32 +00:00
Defensive cheats folder (#220)
This commit is contained in:
parent
44d072de94
commit
751393309f
2 changed files with 6 additions and 2 deletions
|
@ -130,7 +130,11 @@ fn read_file(
|
|||
pub fn read_all(config: &Config, stdin: &mut std::process::ChildStdin) -> HashMap<String, Value> {
|
||||
let mut variables: HashMap<String, Value> = HashMap::new();
|
||||
|
||||
let fallback = format!("{}/cheats", filesystem::exe_path_string());
|
||||
let current_exe = filesystem::exe_path_string();
|
||||
let fallback = format!(
|
||||
"{}/cheats:{}/../cheats:{}/../libexec/cheats",
|
||||
current_exe, current_exe, current_exe
|
||||
);
|
||||
let folders_str = config.path.as_ref().unwrap_or(&fallback);
|
||||
let folders = folders_str.split(':');
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ fn follow_symlink(pathbuf: PathBuf) -> PathBuf {
|
|||
}
|
||||
|
||||
fn exe_pathbuf() -> PathBuf {
|
||||
let pathbuf = std::env::current_exe().unwrap().to_path_buf();
|
||||
let pathbuf = std::env::current_exe().unwrap();
|
||||
follow_symlink(pathbuf)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue