fix: remove slashes from repo name for tmp dir

This commit is contained in:
əlemi 2024-02-14 00:01:30 +01:00
parent 8f50fcc1eb
commit f39c60367a
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -117,7 +117,7 @@ fn tci_hook(repo_path: &std::path::PathBuf, tci_script: &str) -> Result<(), TciE
name.remove(name.chars().count()); 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? // TODO allow customizing clone? just clone recursive? just let hook setup submodules?
git2::Repository::clone( 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}'"); println!("[=] running tci script for repo '{name}'");
std::env::set_current_dir(tmp.path())?; 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)?; std::env::set_current_dir(repo_path)?;
res res