diff options
| author | diogo464 <[email protected]> | 2021-12-24 21:09:44 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2021-12-24 21:09:44 +0000 |
| commit | 6817631ddee3795af3a558bf38e477da4ae5b1cb (patch) | |
| tree | 96b54bc5fcef87046e065726574a473e10989124 /dotup_cli/src/commands/status.rs | |
| parent | ffcb43df8f39a55be468cf4bdfecd72dd026d940 (diff) | |
made install-path a global option
Diffstat (limited to 'dotup_cli/src/commands/status.rs')
| -rw-r--r-- | dotup_cli/src/commands/status.rs | 8 |
1 files changed, 3 insertions, 5 deletions
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 { | |||
| 25 | #[derive(Debug)] | 25 | #[derive(Debug)] |
| 26 | struct State { | 26 | struct State { |
| 27 | max_depth: u32, | 27 | max_depth: u32, |
| 28 | install_base: PathBuf, | 28 | install_path: PathBuf, |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { | 31 | pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { |
| @@ -67,9 +67,7 @@ pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { | |||
| 67 | 67 | ||
| 68 | let state = State { | 68 | let state = State { |
| 69 | max_depth: u32::MAX, | 69 | max_depth: u32::MAX, |
| 70 | install_base: opts | 70 | install_path: config.install_path, |
| 71 | .install_base | ||
| 72 | .unwrap_or(utils::home_directory().unwrap()), | ||
| 73 | }; | 71 | }; |
| 74 | 72 | ||
| 75 | let (directories, files) = utils::collect_read_dir_split(".")?; | 73 | let (directories, files) = utils::collect_read_dir_split(".")?; |
| @@ -142,7 +140,7 @@ fn print_link(depot: &Depot, state: &State, link: &Link, depth: u32) { | |||
| 142 | }; | 140 | }; |
| 143 | 141 | ||
| 144 | print_identation(depth); | 142 | print_identation(depth); |
| 145 | if depot.is_link_installed(link, &state.install_base) { | 143 | if depot.is_link_installed(link, &state.install_path) { |
| 146 | println!( | 144 | println!( |
| 147 | "{} -> {}", | 145 | "{} -> {}", |
| 148 | Colour::Green.paint(&format!("{}", filename.to_string_lossy())), | 146 | Colour::Green.paint(&format!("{}", filename.to_string_lossy())), |
