pub fn from_git(remote: &str, sub: Option<&str>) -> Result<Template> {
        // Clone the remote in git first in /tmp
        let mut tmp = env::temp_dir();
        tmp.push(remote.split('/').last().unwrap_or_else(|| "kickstart"));
        if tmp.exists() {
            fs::remove_dir_all(&tmp)?;
        }
        println!("Cloning the repository in your temporary folder...");

        // Use git command rather than git2 as it seems there are some issues building it
        // on some platforms:
        // https://www.reddit.com/r/rust/comments/92mbk5/kickstart_a_scaffolding_tool_to_get_new_projects/e3ahegw
        Command::new("git")
            .args(&["clone", remote, &format!("{}", tmp.display())])
            .output()
            .map_err(|err| new_error(ErrorKind::Git { err }))?;

        Ok(Template::from_local(&tmp, sub))
    }
/// Load a template from git.
/// This will clone the repository if possible in the temporary directory of the user
Load a template from git.
This will clone the repository if possible in the temporary directory of the user
Load a template from git . This will clone the repository if possible in the temporary directory of the user
pub fn from_git(remote: &str, sub: Option<&str>) -> Result<Template> {
        // Clone the remote in git first in /tmp
        let mut tmp = env::temp_dir();
        tmp.push(remote.split('/').last().unwrap_or_else(|| "kickstart"));
        if tmp.exists() {
            fs::remove_dir_all(&tmp)?;
        }
        println!("Cloning the repository in your temporary folder...");
        // Use git command rather than git2 as it seems there are some issues building it
        // on some platforms:
        // https://www.reddit.com/r/rust/comments/92mbk5/kickstart_a_scaffolding_tool_to_get_new_projects/e3ahegw
        Command::new("git")
            .args(&["clone", remote, &format!("{}", tmp.display())])
            .output()
            .map_err(|err| new_error(ErrorKind::Git { err }))?;
        Ok(Template::from_local(&tmp, sub))
    }
pub fn from_git ( remote : & str , sub : Option < & str > ) -> Result < Template > { // Clone the remote in git first in /tmp let mut tmp = env :: temp_dir ( ) ; tmp . push ( remote . split ( '/' ) . last ( ) . unwrap_or_else ( | | " " ) ) ; if tmp . exists ( ) { fs :: remove_dir_all ( & tmp ) ? ; } println ! ( " " ) ; // Use git command rather than git2 as it seems there are some issues building it // on some platforms: // https://www.reddit.com/r/rust/comments/92mbk5/kickstart_a_scaffolding_tool_to_get_new_projects/e3ahegw Command :: new ( " " ) . args ( & [ " " , remote , & format ! ( " " tmp display ( ) ) ] ) . output ( ) . map_err ( | err | new_error ( ErrorKind :: Git { err } ) ) ? ; Ok ( Template :: from_local ( & tmp , sub ) ) }
Load a template from git.
Load a template from git .
remote
&str
sub
Option<&str>