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/status.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'dotup_cli/src/commands/status.rs') diff --git a/dotup_cli/src/commands/status.rs b/dotup_cli/src/commands/status.rs index e05ada9..b7221db 100644 --- a/dotup_cli/src/commands/status.rs +++ b/dotup_cli/src/commands/status.rs @@ -25,7 +25,7 @@ pub struct Opts { #[derive(Debug)] struct State { max_depth: u32, - install_base: PathBuf, + install_path: PathBuf, } pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { @@ -67,9 +67,7 @@ pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { let state = State { max_depth: u32::MAX, - install_base: opts - .install_base - .unwrap_or(utils::home_directory().unwrap()), + install_path: config.install_path, }; let (directories, files) = utils::collect_read_dir_split(".")?; @@ -142,7 +140,7 @@ fn print_link(depot: &Depot, state: &State, link: &Link, depth: u32) { }; print_identation(depth); - if depot.is_link_installed(link, &state.install_base) { + if depot.is_link_installed(link, &state.install_path) { println!( "{} -> {}", Colour::Green.paint(&format!("{}", filename.to_string_lossy())), -- cgit