mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-02-22 02:27:47 +01:00
17 lines
394 B
Rust
17 lines
394 B
Rust
use crate::error::Error::GitNotFound;
|
|
use crate::error::Result;
|
|
use std::path::Path;
|
|
use std::process::Command;
|
|
|
|
pub(crate) fn new_binary_command(dir: &Path) -> Result<Command> {
|
|
let status = Command::new("git").arg("--version").status();
|
|
|
|
if let Err(_) = status {
|
|
return Err(GitNotFound);
|
|
}
|
|
|
|
let mut cmd = Command::new("git");
|
|
cmd.arg("-C").arg(dir);
|
|
Ok(cmd)
|
|
}
|