diff options
Diffstat (limited to 'src/shell_install')
-rw-r--r-- | src/shell_install/bash.rs | 6 | ||||
-rw-r--r-- | src/shell_install/mod.rs | 12 | ||||
-rw-r--r-- | src/shell_install/util.rs | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/shell_install/bash.rs b/src/shell_install/bash.rs index ac4ecf0..0ace0a3 100644 --- a/src/shell_install/bash.rs +++ b/src/shell_install/bash.rs @@ -148,7 +148,11 @@ pub fn install(si: &mut ShellInstall) -> Result<(), ProgramError> { for sourcing_path in &sourcing_paths { let sourcing_path_str = sourcing_path.to_string_lossy(); if util::file_contains_line(sourcing_path, &source_line)? { - mad_print_inline!(&si.skin, "`$0` already patched, no change made.\n", &sourcing_path_str); + mad_print_inline!( + &si.skin, + "`$0` already patched, no change made.\n", + &sourcing_path_str + ); } else { let mut shellrc = OpenOptions::new() .write(true) diff --git a/src/shell_install/mod.rs b/src/shell_install/mod.rs index dbc0c38..0613c94 100644 --- a/src/shell_install/mod.rs +++ b/src/shell_install/mod.rs @@ -25,7 +25,7 @@ The function is either missing, old or badly installed. Can I install it now? [**Y** n] "#; -const MD_INSTALL_DONE : &str = r#" +const MD_INSTALL_DONE: &str = r#" The **br** function has been installed. You may have to restart your shell or source your shell init files. Afterwards, you should start broot with `br` in order to use its full power. @@ -128,7 +128,7 @@ impl ShellInstall { "bash" | "zsh" => println!("{}", bash::get_script()), "fish" => println!("{}", fish::get_script()), _ => { - return Err(ProgramError::UnknowShell{ + return Err(ProgramError::UnknowShell { shell: shell.to_string(), }); } @@ -196,7 +196,7 @@ impl ShellInstall { if !proceed { ShellInstallState::Refused.write_file()?; self.skin.print_text( - "**Installation cancelled**. If you change your mind, run `broot --install`." + "**Installation cancelled**. If you change your mind, run `broot --install`.", ); } Ok(proceed) @@ -211,7 +211,11 @@ impl ShellInstall { self.remove(&script_path)?; info!("Writing `br` shell function in `{:?}`", &script_path); let script_path_str = script_path.to_string_lossy(); - mad_print_inline!(&self.skin, "Writing *br* shell function in `$0`.\n", &script_path_str); + mad_print_inline!( + &self.skin, + "Writing *br* shell function in `$0`.\n", + &script_path_str + ); fs::create_dir_all(script_path.parent().unwrap())?; fs::write(&script_path, content)?; Ok(()) diff --git a/src/shell_install/util.rs b/src/shell_install/util.rs index 056eb51..41fd0e2 100644 --- a/src/shell_install/util.rs +++ b/src/shell_install/util.rs @@ -1,6 +1,6 @@ use std::{ - fs::self, + fs, io::{self, BufRead, BufReader}, path::Path, }; |