1
0
Fork 0

add repo browse

This commit is contained in:
Cyborus04 2023-07-11 13:05:00 -04:00
parent 22aad204d3
commit d3fe4091a3
No known key found for this signature in database
3 changed files with 44 additions and 0 deletions

View file

@ -44,6 +44,7 @@ pub enum RepoCommand {
push: bool
},
Info,
Browse,
}
#[derive(Subcommand, Clone, Debug)]
@ -149,6 +150,11 @@ async fn main() -> eyre::Result<()> {
None => eprintln!("repo not found"),
}
}
RepoCommand::Browse => {
let (host_domain, host_keys, repo) = keys.get_current_host_and_repo().await?;
let (_, user) = host_keys.get_current_user()?;
open::that(format!("http://{host_domain}/{}/{repo}", user.name))?;
}
},
Command::User { host } => {
let (host_domain, host_keys) = match host.as_deref() {