alma/src/tool/mod.rs
James McMurray 3ca2e01f1f
Bump which to version 4 removing failure dependency (#55)
We are now completely free of failure dependencies!
2020-06-18 08:56:37 +03:00

27 lines
429 B
Rust

mod chroot;
mod mount;
mod qemu;
pub use chroot::chroot;
pub use mount::mount;
pub use qemu::qemu;
use std::path::PathBuf;
use std::process::Command;
use which::which;
#[derive(Debug)]
pub struct Tool {
exec: PathBuf,
}
impl Tool {
pub fn find(name: &'static str) -> anyhow::Result<Self> {
Ok(Self { exec: which(name)? })
}
pub fn execute(&self) -> Command {
Command::new(&self.exec)
}
}