mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-12-06 19:29:21 +01:00
Bump which to version 4 removing failure dependency (#55)
We are now completely free of failure dependencies!
This commit is contained in:
@@ -6,7 +6,6 @@ pub use chroot::chroot;
|
||||
pub use mount::mount;
|
||||
pub use qemu::qemu;
|
||||
|
||||
use anyhow::anyhow;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
use which::which;
|
||||
@@ -18,16 +17,7 @@ pub struct Tool {
|
||||
|
||||
impl Tool {
|
||||
pub fn find(name: &'static str) -> anyhow::Result<Self> {
|
||||
// Note this conversion is only necessary until which releases their new version using
|
||||
// thiserror instead of failure - then we can just use .with_context() on the thiserror
|
||||
// Error
|
||||
// Commit pending release:
|
||||
// BLOCKED: https://github.com/harryfei/which-rs/commit/e6e839c4f6cdf8d3e33ec7eafdd50d34472740ea
|
||||
let which = match which(name) {
|
||||
Ok(x) => Ok(x),
|
||||
Err(_) => Err(anyhow!("Could not find tool: {}", name)),
|
||||
}?;
|
||||
Ok(Self { exec: which })
|
||||
Ok(Self { exec: which(name)? })
|
||||
}
|
||||
|
||||
pub fn execute(&self) -> Command {
|
||||
|
||||
Reference in New Issue
Block a user