..
auth
block
checkout
clean
clone
cob
config
debug
follow
fork
id
inbox
init
inspect
issue
ls
node
patch
path
publish
remote
seed
self
stats
sync
unblock
unfollow
unseed
watch
auth.rs
block.rs
checkout.rs
clean.rs
clone.rs
cob.rs
config.rs
debug.rs
diff.rs
follow.rs
fork.rs
id.rs
inbox.rs
init.rs
inspect.rs
issue.rs
ls.rs
node.rs
patch.rs
path.rs
publish.rs
remote.rs
seed.rs
self.rs
stats.rs
sync.rs
unblock.rs
unfollow.rs
unseed.rs
watch.rs
mod args;
use radicle::node::Handle;
use crate::terminal as term;
pub use args::Args;
pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
let profile = ctx.profile()?;
let mut node = radicle::Node::new(profile.socket_from_env());
let nid = args.nid;
let unfollowed = match node.unfollow(nid) {
Ok(updated) => updated,
Err(e) if e.is_connection_err() => {
let mut config = profile.policies_mut()?;
config.unfollow(&nid)?
}
Err(e) => return Err(e.into()),
};
if unfollowed {
term::success!("Follow policy for {} removed", term::format::tertiary(nid),);
}
Ok(())
}