add ls command

This commit is contained in:
breadone 2024-03-10 18:07:20 +13:00
parent b7eb893672
commit 2ada601e06
No known key found for this signature in database

View File

@ -12,7 +12,7 @@ pub enum GitCommand {
},
/// List all repositories in breadpi.
List,
Ls,
/// Delete the specified repository in breadpi.
Delete {
@ -63,6 +63,19 @@ pub async fn handle_git(cmd: &GitCommand) {
);
}
GitCommand::Ls => {
let ls = session.command("ls")
.arg("store/")
.arg("|")
.arg("cat")
.output().await.unwrap();
eprintln!(
"{}",
String::from_utf8(ls.stdout).expect("Failed to rm repo.")
);
}
GitCommand::Add { name } => { add_remote_to_repo(name.to_string()); }
_ => {