From 58ff7a0090d6cffad906f6bdf9addcd23e7a478f Mon Sep 17 00:00:00 2001 From: jan Michal Date: Mon, 24 Jan 2022 17:12:23 +0000 Subject: [PATCH] git magic created too many issues --- src/main.rs | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/main.rs b/src/main.rs index 55137d4..75f7743 100755 --- a/src/main.rs +++ b/src/main.rs @@ -111,39 +111,11 @@ fn main() { for r in config.repo { info(format!("Cloning (repository mode): {}", r)); Command::new("git") - .args(&["clone", "--no-checkout", &r]) - .spawn() - .unwrap() - .wait() - .unwrap(); - - info(format!("Entering working directory: {}", r)); - let cdir = env::current_dir().unwrap(); - let dir = format!( - "{}/{}", - env::current_dir().unwrap().display(), - r.split('/').collect::>().last().unwrap() - ); - env::set_current_dir(dir).unwrap(); - - info(format!("Resetting unstaged files: {}", r)); - Command::new("git") - .arg("reset") - .spawn() - .unwrap() - .wait() - .unwrap(); - - info(format!("Checking out PKGBUILD: {}", r)); - Command::new("git") - .args(&["checkout", "HEAD", "PKGBUILD"]) + .args(&["clone", &r]) .spawn() .unwrap() .wait() .unwrap(); - - info(format!("Exiting work directory: {}", r)); - env::set_current_dir(cdir).unwrap(); } } else { crash("Invalid mode in mlc.toml".to_string(), 1); @@ -307,4 +279,4 @@ fn main() { .wait() .unwrap(); } -} \ No newline at end of file +}