diff options
| author | diogo464 <[email protected]> | 2022-02-08 09:21:12 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2022-02-08 09:21:12 +0000 |
| commit | 92b05a877eb772985d2f4fc9cd198ca642b69b6a (patch) | |
| tree | 4a2edc173b8809e929e4abc47899ae9c6d956684 /dotup_cli/src/commands/install.rs | |
| parent | 0992c36733f58750da93921041424fd09f0158ed (diff) | |
removed old code
Diffstat (limited to 'dotup_cli/src/commands/install.rs')
| -rw-r--r-- | dotup_cli/src/commands/install.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/dotup_cli/src/commands/install.rs b/dotup_cli/src/commands/install.rs deleted file mode 100644 index 6d9fbf7..0000000 --- a/dotup_cli/src/commands/install.rs +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | use std::path::PathBuf; | ||
| 2 | |||
| 3 | use super::prelude::*; | ||
| 4 | |||
| 5 | /// Install links. (Creates symlinks). | ||
| 6 | /// | ||
| 7 | /// Installing a link will create the necessary directories. | ||
| 8 | /// If a file or directory already exists at the location a link would be installed this command will fail. | ||
| 9 | #[derive(Parser)] | ||
| 10 | pub struct Opts { | ||
| 11 | /// The files/directories to install. | ||
| 12 | #[clap(min_values = 1, default_value = ".")] | ||
| 13 | paths: Vec<PathBuf>, | ||
| 14 | } | ||
| 15 | |||
| 16 | pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { | ||
| 17 | let depot = utils::read_depot(&config.archive_path)?; | ||
| 18 | |||
| 19 | for link in utils::collect_links_by_base_paths(&depot, &opts.paths) { | ||
| 20 | log::info!("Installing link {}", link); | ||
| 21 | depot.install_link(link, &config.install_path)?; | ||
| 22 | } | ||
| 23 | |||
| 24 | Ok(()) | ||
| 25 | } | ||
