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:
parent
027ccb943e
commit
fb44af9653
|
|
@ -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(())
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue