You've already forked AstralRinth
forked from didirus/AstralRinth
@@ -232,11 +232,12 @@ pub async fn launch_minecraft(
|
|||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
)
|
)
|
||||||
.current_dir(instance_path.clone())
|
.current_dir(instance_path.clone())
|
||||||
.env_clear()
|
|
||||||
.envs(env_args)
|
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.stderr(Stdio::piped());
|
.stderr(Stdio::piped());
|
||||||
|
|
||||||
|
// Clear cargo-added env varaibles for debugging, and add settings env vars
|
||||||
|
clear_cargo_env_vals(&mut command).envs(env_args);
|
||||||
|
|
||||||
// Create Minecraft child by inserting it into the state
|
// Create Minecraft child by inserting it into the state
|
||||||
// This also spawns the process and prepares the subsequent processes
|
// This also spawns the process and prepares the subsequent processes
|
||||||
let mut state_children = state.children.write().await;
|
let mut state_children = state.children.write().await;
|
||||||
@@ -249,3 +250,12 @@ pub async fn launch_minecraft(
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clear_cargo_env_vals(command: &mut Command) -> &mut Command {
|
||||||
|
for (key, _) in std::env::vars() {
|
||||||
|
if key.starts_with("CARGO") {
|
||||||
|
command.env_remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
command
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user