Skip to content

Commit 363282c

Browse files
committed
fix for unix
1 parent 6e5c060 commit 363282c

File tree

1 file changed

+12
-4
lines changed
  • crates/pixi_conda/src/run

1 file changed

+12
-4
lines changed

crates/pixi_conda/src/run/mod.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use std::{path::PathBuf, process::Stdio};
2-
31
use clap::Parser;
4-
use miette::{IntoDiagnostic, Report};
2+
use miette::IntoDiagnostic;
53
use pixi_config::Config;
64
use rattler_conda_types::Platform;
75
use rattler_shell::shell::ShellEnum;
6+
use std::{path::PathBuf, process::Stdio};
87

98
use crate::{registry::Registry, EnvironmentName};
109

@@ -93,10 +92,19 @@ pub async fn execute(_config: Config, mut args: Args) -> miette::Result<()> {
9392

9493
// Spawn the child process
9594
#[cfg(target_family = "unix")]
96-
command.exec();
95+
{
96+
use std::os::unix::process::CommandExt;
97+
98+
// Exec replaces the current process with the new one and does not return!
99+
let err = command.exec();
100+
101+
// If we get here, the exec failed
102+
miette::bail!("Failed to execute '{}': {}", executable, err);
103+
}
97104

98105
#[cfg(target_os = "windows")]
99106
{
107+
use miette::Report;
100108
let mut child = match command.spawn() {
101109
Ok(child) => child,
102110
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {

0 commit comments

Comments
 (0)