From ac4c23929e32e390292bad0013223a59f28b5da9 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Mon, 10 May 2021 09:40:23 +0300 Subject: [PATCH] No need to run which in WSL (fix #694) (#707) * No need to run which in WSL (fix #694) * clippy --- src/steps/os/windows.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/steps/os/windows.rs b/src/steps/os/windows.rs index d69acdc6..cc74ac07 100644 --- a/src/steps/os/windows.rs +++ b/src/steps/os/windows.rs @@ -1,9 +1,9 @@ use crate::execution_context::ExecutionContext; -use crate::executor::{CommandExt, RunType}; +use crate::executor::RunType; use crate::powershell; +use crate::steps::git::Repositories; use crate::terminal::print_separator; use crate::utils::require; -use crate::{error::SkipStep, steps::git::Repositories}; use anyhow::Result; use log::debug; use std::convert::TryFrom; @@ -52,15 +52,8 @@ pub fn run_scoop(cleanup: bool, run_type: RunType) -> Result<()> { pub fn run_wsl_topgrade(ctx: &ExecutionContext) -> Result<()> { let wsl = require("wsl")?; - let topgrade = Command::new(&wsl) - .args(&["bash", "-lc", "which topgrade"]) - .check_output() - .map_err(|_| SkipStep(String::from("Could not find Topgrade installed in WSL")))?; - let mut command = ctx.run_type().execute(&wsl); - command - .args(&["bash", "-c"]) - .arg(format!("TOPGRADE_PREFIX=WSL exec {}", topgrade)); + command.args(&["bash", "-lc"]).arg("TOPGRADE_PREFIX=WSL exec topgrade"); if ctx.config().yes() { command.arg("-y");