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 {
|
match cmd {
|
||||||
GitCommand::Create { name } => {
|
GitCommand::Create { name } => {
|
||||||
let mkdir = format!("~/store/{name}");
|
let init = session.command("git")
|
||||||
let cd = format!("cd ~/store/{name}");
|
.arg("init")
|
||||||
let init = format!("git --bare init");
|
.arg("--bare")
|
||||||
|
.arg("store/".to_owned() + name + ".git")
|
||||||
session.command(mkdir)
|
|
||||||
.args(["-p", &mkdir])
|
|
||||||
.output().await.unwrap();
|
.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