FINALLY git create is working

This commit is contained in:
breadone 2024-03-10 17:30:36 +13:00
parent 2191d54386
commit 4217c80a57
No known key found for this signature in database

View File

@ -21,15 +21,16 @@ pub async fn handle_git(cmd: &GitCommand) {
match cmd {
GitCommand::Create { name } => {
let mkdir = format!("~/store/{name}");
let cd = format!("cd ~/store/{name}");
let init = format!("git --bare init");
session.command(mkdir)
.args(["-p", &mkdir])
let init = session.command("git")
.arg("init")
.arg("--bare")
.arg("store/".to_owned() + name + ".git")
.output().await.unwrap();
session.command(cd).output().await.unwrap();
session.command(init).output().await.unwrap();
eprintln!(
"{}",
String::from_utf8(init.stdout).expect("Failed to init git repo.")
);
}
_ => {