mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 14:31:30 +03:00
logic simplified
This commit is contained in:
parent
a77f3ad6e3
commit
21d59b5e05
@ -48,16 +48,16 @@ pub fn resolve_vscode_variant() -> &'static str {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn check_if_installed(executable_name: &str) -> bool {
|
fn check_if_installed(executable_name: &str) -> bool {
|
||||||
let paths = match env::var_os("PATH") {
|
match env::var_os("PATH") {
|
||||||
Some(path) => env::split_paths(&path).collect::<Vec<_>>(),
|
Some(env_path) => env::split_paths(&env_path)
|
||||||
None => vec![],
|
.filter_map(|mut path| {
|
||||||
};
|
path.push(executable_name);
|
||||||
|
fs::metadata(path).ok()
|
||||||
paths.into_iter().any(|mut path| {
|
})
|
||||||
path.push(executable_name);
|
.next()
|
||||||
//println!("{}", path.to_string_lossy());
|
.is_some(),
|
||||||
fs::metadata(path).is_ok()
|
None => false,
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build(_package_info: &PackageInfo) -> Menu {
|
pub fn build(_package_info: &PackageInfo) -> Menu {
|
||||||
|
Loading…
Reference in New Issue
Block a user