Made clone_repo error clear.

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

No files matched your search

+1 -3
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::*;
+8 -2
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(())
}