Removed unnecessary map call in bash PathBuf (#168)
This commit is contained in:
committed by
Roey Darwish Dror
parent
cb180d9c01
commit
8428c4d21d
@@ -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()?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user