mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 02:20:43 +08:00
cli: use WriteStorage::remove in rm
Instead of calling `std::fs::remove_dir_all` in the `rad rm` command, use the `WriteStorage::remove` method. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use std::ffi::OsString;
|
||||
use std::fs;
|
||||
|
||||
use anyhow::anyhow;
|
||||
|
||||
@@ -7,6 +6,7 @@ use radicle::identity::Id;
|
||||
use radicle::node;
|
||||
use radicle::node::Handle as _;
|
||||
use radicle::storage;
|
||||
use radicle::storage::WriteStorage;
|
||||
use radicle::Profile;
|
||||
|
||||
use crate::git;
|
||||
@@ -82,7 +82,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
if !options.confirm || term::confirm(format!("Remove {rid}?")) {
|
||||
untrack(&rid, &profile)?;
|
||||
remove_remote(&rid)?;
|
||||
fs::remove_dir_all(path)?;
|
||||
storage.remove(rid)?;
|
||||
term::success!("Successfully removed {rid} from storage");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user