From f39c60367a4b8b4f47c4b0171eb9af7e81cc45d8 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 14 Feb 2024 00:01:30 +0100 Subject: [PATCH] fix: remove slashes from repo name for tmp dir --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 26207f8..278bc4b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,7 +117,7 @@ fn tci_hook(repo_path: &std::path::PathBuf, tci_script: &str) -> Result<(), TciE name.remove(name.chars().count()); } - let tmp = tempdir::TempDir::new(&format!("tci-{name}"))?; + let tmp = tempdir::TempDir::new(&format!("tci-{}", name.replace('/', "_")))?; // TODO allow customizing clone? just clone recursive? just let hook setup submodules? git2::Repository::clone( @@ -133,7 +133,7 @@ fn tci_hook(repo_path: &std::path::PathBuf, tci_script: &str) -> Result<(), TciE println!("[=] running tci script for repo '{name}'"); std::env::set_current_dir(tmp.path())?; - let res = shell_out(tmp.path().join(tci_script)); + let res = shell_out(tci_path); std::env::set_current_dir(repo_path)?; res