Made clone_repo error clear.

This commit is contained in:
Ell 2023-04-24 15:40:00 +05:00
parent 9ce5fc508d
commit 60eb453aad
2 changed files with 9 additions and 5 deletions

View file

@ -1,8 +1,6 @@
use std::process::exit;
use dioxus_rsx::{BodyNode, CallBody, Component};
use proc_macro2::{Ident, Span};
use syn::punctuated::Punctuated;
use dioxus_rsx::{BodyNode, CallBody};
use super::*;

View file

@ -1,6 +1,6 @@
use std::{
fs::{create_dir_all, File},
io::{Read, Write},
io::{Read, Write, ErrorKind},
path::{Path, PathBuf},
process::Command,
};
@ -46,7 +46,13 @@ pub fn clone_repo(dir: &Path, url: &str) -> anyhow::Result<()> {
let mut cmd = Command::new("git");
let cmd = cmd.current_dir(target_dir);
let _res = cmd.arg("clone").arg(url).arg(dir_name).output()?;
let res = cmd.arg("clone").arg(url).arg(dir_name).output();
if let Err(err) = res {
if ErrorKind::NotFound == err.kind() {
log::error!("Git program not found. Hint: Install git or check $PATH.");
return Err(err.into());
}
}
Ok(())
}