workflows 0.7.2

A cli tool for creating a seemless workflow with remote and local git repos
1
2
3
4
5
6
7
8
9
10
11
12
use crate::config::WorkflowsConfig;
use crate::{intergrations, repo::Repo};

/// Attempts to clone the git repo at the given url into the user's project folder
pub fn git_clone(url: Option<String>, config: &WorkflowsConfig) -> Option<Repo> {
    let project_dir = intergrations::git::clone_repo(&url.clone()?, config).ok()?;

    // Parsing the url
    let project_name = url?.split('/').last()?.replace(".git", "");

    Some(Repo::new(project_name, true, Some(project_dir)))
}