aboutsummaryrefslogtreecommitdiff
path: root/dotup_cli/src/commands/uninstall.rs
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2022-02-08 09:21:12 +0000
committerdiogo464 <[email protected]>2022-02-08 09:21:12 +0000
commit92b05a877eb772985d2f4fc9cd198ca642b69b6a (patch)
tree4a2edc173b8809e929e4abc47899ae9c6d956684 /dotup_cli/src/commands/uninstall.rs
parent0992c36733f58750da93921041424fd09f0158ed (diff)
removed old code
Diffstat (limited to 'dotup_cli/src/commands/uninstall.rs')
-rw-r--r--dotup_cli/src/commands/uninstall.rs26
1 files changed, 0 insertions, 26 deletions
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 @@
1use std::path::PathBuf;
2
3use super::prelude::*;
4
5/// Uninstalls links. (Removes symlinks).
6///
7/// Uninstalling a link for a file that didnt have a link will do nothing.
8/// Uninstalling a directory will recursively uninstall all files under it.
9/// Symlinks are only deleted if they were pointing to the correct file.
10#[derive(Parser)]
11pub struct Opts {
12 /// The files/directories to uninstall.
13 #[clap(min_values = 1, default_value = ".")]
14 paths: Vec<PathBuf>,
15}
16
17pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> {
18 let depot = utils::read_depot(&config.archive_path)?;
19
20 for link in utils::collect_links_by_base_paths(&depot, &opts.paths) {
21 log::info!("Uninstalling link : {}", link);
22 depot.uninstall_link(link, &config.install_path)?;
23 }
24
25 Ok(())
26}