clone repo to specific directory on host

This commit is contained in:
mbecker20
2024-06-14 23:43:47 -07:00
parent f926932181
commit eb029d0408
5 changed files with 26 additions and 2 deletions

View File

@@ -1,4 +1,7 @@
use std::path::Path;
use std::{
path::{Path, PathBuf},
str::FromStr,
};
use anyhow::Context;
use command::run_monitor_command;
@@ -77,6 +80,7 @@ where
repo,
branch,
commit,
destination,
on_clone,
on_pull,
..
@@ -85,7 +89,11 @@ where
let repo = repo.as_ref().context("build has no repo attached")?;
let name = to_monitor_name(&name);
let repo_dir = repo_dir.join(name);
let repo_dir = match destination {
Some(destination) => PathBuf::from_str(&destination)
.context("destination is not valid path")?,
None => repo_dir.join(name),
};
let mut logs =
clone_inner(repo, &repo_dir, &branch, &commit, github_token)