fix: prevent redundant plugin path checks for /usr/bin directory
This commit is contained in:
1 parent
c4982665a6
commit
6c88f618cf
1 file changed
+3
@@ -137,10 +137,13 @@ impl PluginRegistry {
|
|||||||
Ok(executable) => {
|
Ok(executable) => {
|
||||||
tracing::trace!(executable = %executable.display(), "resolved current executable");
|
tracing::trace!(executable = %executable.display(), "resolved current executable");
|
||||||
if let Some(parent) = executable.parent() {
|
if let Some(parent) = executable.parent() {
|
||||||
|
// Avoids checking the entire /usr/bin folder on every runtime, since there will never be a lib file there
|
||||||
|
if parent.to_path_buf() != PathBuf::from("/usr/bin") {
|
||||||
directories.push(parent.to_path_buf());
|
directories.push(parent.to_path_buf());
|
||||||
directories.push(parent.join("plugins"));
|
directories.push(parent.join("plugins"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Err(error) => tracing::debug!(%error, "could not resolve current executable"),
|
Err(error) => tracing::debug!(%error, "could not resolve current executable"),
|
||||||
}
|
}
|
||||||
if let Some(home) = std::env::var_os("HOME") {
|
if let Some(home) = std::env::var_os("HOME") {
|
||||||
|
|||||||
Reference in new issue
Block a user