[F] Continue even when current path is not found (Fixes #426)
This commit is contained in:
parent
f32e2df4fa
commit
b81d5fed1b
1 changed files with 7 additions and 1 deletions
|
|
@ -155,7 +155,13 @@ pub fn add_pkg_path() -> Result<()> {
|
|||
// Get PATH
|
||||
let pv = &env::var_os("PATH").context("`PATH` env var is not set or invalid")?;
|
||||
let mut path = env::split_paths(pv).collect::<Vec<_>>();
|
||||
let exe = env::current_exe().context("failed to get path of current running executable")?;
|
||||
let exe = match env::current_exe() {
|
||||
Ok(exe) => exe,
|
||||
Err(e) => {
|
||||
debug!("Failed to get path of current running executable: {}", e);
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
let base = exe.parent().unwrap();
|
||||
|
||||
// Add from bin: ../git, ../fastfetch, ../scripts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue