From 92b05a877eb772985d2f4fc9cd198ca642b69b6a Mon Sep 17 00:00:00 2001 From: diogo464 Date: Tue, 8 Feb 2022 09:21:12 +0000 Subject: removed old code --- dotup_cli/src/commands/uninstall.rs | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 dotup_cli/src/commands/uninstall.rs (limited to 'dotup_cli/src/commands/uninstall.rs') diff --git a/dotup_cli/src/commands/uninstall.rs b/dotup_cli/src/commands/uninstall.rs deleted file mode 100644 index fe44bf0..0000000 --- a/dotup_cli/src/commands/uninstall.rs +++ /dev/null @@ -1,26 +0,0 @@ -use std::path::PathBuf; - -use super::prelude::*; - -/// Uninstalls links. (Removes symlinks). -/// -/// Uninstalling a link for a file that didnt have a link will do nothing. -/// Uninstalling a directory will recursively uninstall all files under it. -/// Symlinks are only deleted if they were pointing to the correct file. -#[derive(Parser)] -pub struct Opts { - /// The files/directories to uninstall. - #[clap(min_values = 1, default_value = ".")] - paths: Vec, -} - -pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { - let depot = utils::read_depot(&config.archive_path)?; - - for link in utils::collect_links_by_base_paths(&depot, &opts.paths) { - log::info!("Uninstalling link : {}", link); - depot.uninstall_link(link, &config.install_path)?; - } - - Ok(()) -} -- cgit