cli: implement the rad remote rm command

Implementing the `rad remote rm` command in order to be able
to remote a remote inside the radicle remote list.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo 2023-04-20 21:08:00 +02:00 committed by Alexis Sellier
parent 027ccb943e
commit fb44af9653
No known key found for this signature in database
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
use crate::git;
use crate::terminal as term;
pub fn run(repository: &git::Repository, name: &str) -> anyhow::Result<()> {
if !git::is_remote(repository, name)? {
anyhow::bail!("remote `{name}` not found");
}
repository.remote_delete(name)?;
term::success!("Remote `{name}` removed");
Ok(())
}