Pass target directory as flag instead of env variable

This commit is contained in:
Victor Song 2023-10-04 08:13:01 -05:00
parent 3682c3791b
commit 2290cc3cf3

View file

@ -360,10 +360,6 @@ impl FlycheckActor {
let mut cmd = Command::new(command);
cmd.envs(extra_env);
if let Some(target_dir) = target_dir {
cmd.env("CARGO_TARGET_DIR", target_dir);
}
match invocation_location {
InvocationLocation::Workspace => {
match invocation_strategy {
@ -381,6 +377,10 @@ impl FlycheckActor {
}
}
if let Some(target_dir) = target_dir {
cmd.arg("--target-dir").arg(target_dir);
}
(cmd, args)
}
};