mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-25 03:47:22 +00:00
Made clone_repo error clear.
This commit is contained in:
parent
9ce5fc508d
commit
60eb453aad
2 changed files with 9 additions and 5 deletions
|
@ -1,8 +1,6 @@
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
|
|
||||||
use dioxus_rsx::{BodyNode, CallBody, Component};
|
use dioxus_rsx::{BodyNode, CallBody};
|
||||||
use proc_macro2::{Ident, Span};
|
|
||||||
use syn::punctuated::Punctuated;
|
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|
10
src/tools.rs
10
src/tools.rs
|
@ -1,6 +1,6 @@
|
||||||
use std::{
|
use std::{
|
||||||
fs::{create_dir_all, File},
|
fs::{create_dir_all, File},
|
||||||
io::{Read, Write},
|
io::{Read, Write, ErrorKind},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::Command,
|
process::Command,
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,13 @@ pub fn clone_repo(dir: &Path, url: &str) -> anyhow::Result<()> {
|
||||||
|
|
||||||
let mut cmd = Command::new("git");
|
let mut cmd = Command::new("git");
|
||||||
let cmd = cmd.current_dir(target_dir);
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue