Skip to content

Commit

Permalink
add repo cloning fn
Browse files Browse the repository at this point in the history
  • Loading branch information
benluiwj committed Jun 6, 2024
1 parent c97996f commit ec92e81
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions check_diff/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use clap::Parser;
use std::env;
use std::process::Command;

/// Inputs for the check_diff script
#[derive(Parser)]
struct CliInputs {
Expand All @@ -15,6 +18,17 @@ struct CliInputs {
rustfmt_config: Option<Vec<String>>,
}

fn clone_git_repo(url: String, dest: String) {
env::set_var("GIT_TERMINAL_PROMPT", "0");
let mut git_cmd = Command::new("git");
git_cmd.args(["clone", "--quiet", url, "--depth", "1", "dest"]);
git_cmd.output().expect("failed to clone repository");
let mut enter_dest_dir = Command::new("cd")
.arg(dest)
.output()
.expect("failed to enter directory.");
}

fn main() {
let args = CliInputs::parse();
println!(
Expand Down

0 comments on commit ec92e81

Please sign in to comment.