FINALLY git create is working
This commit is contained in:
parent
2191d54386
commit
4217c80a57
17
src/git.rs
17
src/git.rs
@ -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.")
|
||||
);
|
||||
}
|
||||
|
||||
_ => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user