From 2ada601e06afda987925070ebef2fe1706ff053a Mon Sep 17 00:00:00 2001 From: breadone Date: Sun, 10 Mar 2024 18:07:20 +1300 Subject: [PATCH] add ls command --- src/git.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/git.rs b/src/git.rs index 65549d5..6efefa2 100644 --- a/src/git.rs +++ b/src/git.rs @@ -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()); } _ => {