Skip to content

Commit

Permalink
fix: don't use Command::new(bin_name) as it won't work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC committed Mar 24, 2024
1 parent f4e0258 commit d0e8b7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/steps/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ pub fn run_vscode_extensions_update(ctx: &ExecutionContext) -> Result<()> {

// Vscode has update command only since 1.86 version ("january 2024" update), disable the update for prior versions
// Use command `code --version` which returns 3 lines: version, git commit, instruction set. We parse only the first one
let version: Result<Version> = match Command::new("code")
let version: Result<Version> = match Command::new(&vscode)

Check warning on line 361 in src/steps/generic.rs

View check run for this annotation

Codecov / codecov/patch

src/steps/generic.rs#L361

Added line #L361 was not covered by tests
.arg("--version")
.output_checked_utf8()?
.stdout
Expand Down Expand Up @@ -389,7 +389,7 @@ pub fn run_pipx_update(ctx: &ExecutionContext) -> Result<()> {

// pipx version 1.4.0 introduced a new command argument `pipx upgrade-all --quiet`
// (see https://pipx.pypa.io/stable/docs/#pipx-upgrade-all)
let version_str = Command::new("pipx")
let version_str = Command::new(&pipx)

Check warning on line 392 in src/steps/generic.rs

View check run for this annotation

Codecov / codecov/patch

src/steps/generic.rs#L392

Added line #L392 was not covered by tests
.args(["--version"])
.output_checked_utf8()
.map(|s| s.stdout.trim().to_owned());
Expand All @@ -404,7 +404,7 @@ pub fn run_pipx_update(ctx: &ExecutionContext) -> Result<()> {
pub fn run_conda_update(ctx: &ExecutionContext) -> Result<()> {
let conda = require("conda")?;

let output = Command::new("conda")
let output = Command::new(&conda)

Check warning on line 407 in src/steps/generic.rs

View check run for this annotation

Codecov / codecov/patch

src/steps/generic.rs#L407

Added line #L407 was not covered by tests
.args(["config", "--show", "auto_activate_base"])
.output_checked_utf8()?;
debug!("Conda output: {}", output.stdout);
Expand All @@ -425,7 +425,7 @@ pub fn run_conda_update(ctx: &ExecutionContext) -> Result<()> {
pub fn run_mamba_update(ctx: &ExecutionContext) -> Result<()> {
let mamba = require("mamba")?;

let output = Command::new("mamba")
let output = Command::new(&mamba)

Check warning on line 428 in src/steps/generic.rs

View check run for this annotation

Codecov / codecov/patch

src/steps/generic.rs#L428

Added line #L428 was not covered by tests
.args(["config", "--show", "auto_activate_base"])
.output_checked_utf8()?;
debug!("Mamba output: {}", output.stdout);
Expand Down

0 comments on commit d0e8b7e

Please sign in to comment.