* No need to run which in WSL (fix #694) * clippy
This commit is contained in:
committed by
GitHub
parent
54055a5e10
commit
ac4c23929e
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user