feat: with working main
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-08-03 23:31:53 +02:00
parent 8ee05136df
commit 34417f77bc
8 changed files with 178 additions and 55 deletions

View File

@@ -7,6 +7,7 @@ pub enum VcsClient {
source: PathBuf,
username: String,
email: String,
token: String,
},
}
@@ -19,6 +20,7 @@ impl VcsClient {
path: &Path,
git_username: Option<impl Into<String>>,
git_email: Option<impl Into<String>>,
git_token: String,
) -> anyhow::Result<VcsClient> {
if !path.to_path_buf().join(".git").exists() {
anyhow::bail!("git directory not found in: {}", path.display().to_string())
@@ -32,6 +34,7 @@ impl VcsClient {
email: git_email
.map(|e| e.into())
.unwrap_or("bot@cuddle.sh".to_string()),
token: git_token,
})
}
@@ -56,10 +59,15 @@ impl VcsClient {
source,
username,
email,
token,
} => {
let checkout_branch = std::process::Command::new("git")
.current_dir(source.as_path())
.args([
"-c",
&format!("http.extraHeader='Authorization: token {}'", token),
"-c",
&format!("http.extraHeader='Sudo: kjuulh'"),
"-c",
&format!("user.name={}", username),
"-c",