Skip to content

Commit

Permalink
Fix xtask for non-Windows users
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Feb 28, 2024
1 parent 00339b5 commit f7029a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xtask/src/cargo.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Tools for working with Cargo.

use std::{
env,
path::Path,
process::{Command, Stdio},
};
Expand Down Expand Up @@ -49,14 +48,15 @@ pub fn run_with_input(args: &[String], cwd: &Path) -> Result<()> {

fn get_cargo() -> String {
#[cfg(target_os = "windows")]
let cargo = if let Ok(cargo) = env::var("CARGO_HOME") {
let cargo = if let Ok(cargo) = std::env::var("CARGO_HOME") {
format!("{cargo}/bin/cargo")
} else {
String::from("cargo")
};

#[cfg(not(target_os = "windows"))]
let cargo = "cargo";
let cargo = String::from("cargo");

cargo
}

Expand Down

0 comments on commit f7029a8

Please sign in to comment.