Skip to content

Commit

Permalink
fix: mise plugins ls returns error immediately after install (jdx#2271)
Browse files Browse the repository at this point in the history
  • Loading branch information
roele authored and triarius committed Sep 18, 2024
1 parent 66da21c commit 42da4b3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/plugins/asdf_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ impl AsdfPlugin {

pub fn list() -> eyre::Result<PluginList> {
let settings = Settings::get();
Ok(file::ls(*dirs::PLUGINS)?
.into_par_iter()
.map(|dir| {
let name = dir.file_name().unwrap().to_string_lossy().to_string();
Box::new(AsdfPlugin::new(name)) as Box<dyn Plugin>
})
.filter(|p| !settings.disable_tools.contains(p.name()))
.collect())
match file::ls(*dirs::PLUGINS) {
Ok(dirs) => {
let plugins = dirs
.into_par_iter()
.map(|dir| {
let name = dir.file_name().unwrap().to_string_lossy().to_string();
Box::new(AsdfPlugin::new(name)) as Box<dyn Plugin>
})
.filter(|p| !settings.disable_tools.contains(p.name()))
.collect();
Ok(plugins)
}
Err(_) => Ok(PluginList::new()),
}
}
}

Expand Down

0 comments on commit 42da4b3

Please sign in to comment.