From 8428c4d21ded31f8e691b5f1488a58d40111eaba Mon Sep 17 00:00:00 2001 From: Elton Lika Date: Thu, 13 Jun 2019 13:47:12 +0200 Subject: [PATCH] Removed unnecessary map call in bash PathBuf (#168) --- src/steps/os/unix.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index a0d6cb6f..7ae0d975 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -86,7 +86,7 @@ pub fn run_pearl(run_type: RunType) -> Result<(), Error> { } pub fn run_sdkman(base_dirs: &BaseDirs, cleanup: bool, run_type: RunType) -> Result<(), Error> { - let bash_path = require("bash").map(|p| format!("{}", &p.display()))?; + let bash = require("bash")?; let sdkman_init_path = env::var("SDKMAN_DIR") .map(PathBuf::from) @@ -100,32 +100,29 @@ pub fn run_sdkman(base_dirs: &BaseDirs, cleanup: bool, run_type: RunType) -> Res let cmd_selfupdate = format!("source {} && sdk selfupdate", &sdkman_init_path); run_type - .execute(&bash_path) + .execute(&bash) .args(&["-c", cmd_selfupdate.as_str()]) .check_run()?; let cmd_update = format!("source {} && sdk update", &sdkman_init_path); - run_type - .execute(&bash_path) - .args(&["-c", cmd_update.as_str()]) - .check_run()?; + run_type.execute(&bash).args(&["-c", cmd_update.as_str()]).check_run()?; let cmd_upgrade = format!("source {} && sdk upgrade", &sdkman_init_path); run_type - .execute(&bash_path) + .execute(&bash) .args(&["-c", cmd_upgrade.as_str()]) .check_run()?; if cleanup { let cmd_flush_archives = format!("source {} && sdk flush archives", &sdkman_init_path); run_type - .execute(&bash_path) + .execute(&bash) .args(&["-c", cmd_flush_archives.as_str()]) .check_run()?; let cmd_flush_temp = format!("source {} && sdk flush temp", &sdkman_init_path); run_type - .execute(&bash_path) + .execute(&bash) .args(&["-c", cmd_flush_temp.as_str()]) .check_run()?; }