From 6817631ddee3795af3a558bf38e477da4ae5b1cb Mon Sep 17 00:00:00 2001 From: diogo464 Date: Fri, 24 Dec 2021 21:09:44 +0000 Subject: made install-path a global option --- dotup_cli/src/commands/install.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'dotup_cli/src/commands/install.rs') diff --git a/dotup_cli/src/commands/install.rs b/dotup_cli/src/commands/install.rs index e166a7b..6d9fbf7 100644 --- a/dotup_cli/src/commands/install.rs +++ b/dotup_cli/src/commands/install.rs @@ -8,26 +8,17 @@ use super::prelude::*; /// If a file or directory already exists at the location a link would be installed this command will fail. #[derive(Parser)] pub struct Opts { - /// The location where links will be installed to. - /// Defaults to the home directory. - #[clap(long)] - install_base: Option, - /// The files/directories to install. #[clap(min_values = 1, default_value = ".")] paths: Vec, } pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { - let install_base = match opts.install_base { - Some(path) => path, - None => utils::home_directory()?, - }; let depot = utils::read_depot(&config.archive_path)?; for link in utils::collect_links_by_base_paths(&depot, &opts.paths) { log::info!("Installing link {}", link); - depot.install_link(link, &install_base)?; + depot.install_link(link, &config.install_path)?; } Ok(()) -- cgit