add ls command
This commit is contained in:
parent
b7eb893672
commit
2ada601e06
15
src/git.rs
15
src/git.rs
@ -12,7 +12,7 @@ pub enum GitCommand {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/// List all repositories in breadpi.
|
/// List all repositories in breadpi.
|
||||||
List,
|
Ls,
|
||||||
|
|
||||||
/// Delete the specified repository in breadpi.
|
/// Delete the specified repository in breadpi.
|
||||||
Delete {
|
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()); }
|
GitCommand::Add { name } => { add_remote_to_repo(name.to_string()); }
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user