feat: support supplementary environment variables for hooks in App (#5916)

* feat: Implement launcher supplementary environmental variables, and env var substitution in hooks

* lint fix, prettier reformat

* descriptions added for each environment variable for hook settings

* alphabetize language keys

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Slackow
2026-08-04 22:23:07 +00:00
committed by GitHub
co-authored by Prospector
parent 474c6560fc
commit cc53d9a6f8
7 changed files with 430 additions and 41 deletions
+4 -1
View File
@@ -107,6 +107,7 @@ impl ProcessManager {
instance_name: &str,
mut mc_command: Command,
post_exit_command: Option<String>,
post_exit_env_vars: Vec<(String, String)>,
logs_folder: PathBuf,
xml_logging: bool,
main_class_keep_alive: TempDir,
@@ -217,6 +218,7 @@ impl ProcessManager {
instance_id.to_string(),
instance_path.to_string(),
post_exit_command,
post_exit_env_vars,
metadata.uuid,
));
@@ -750,6 +752,7 @@ impl Process {
instance_id: String,
instance_path: String,
post_exit_command: Option<String>,
post_exit_env_vars: Vec<(String, String)>,
uuid: Uuid,
) -> crate::Result<()> {
async fn update_playtime(
@@ -885,7 +888,7 @@ impl Process {
if let Some(command) = cmd.next() {
let mut command = Command::new(command);
command.args(cmd).current_dir(
command.args(cmd).envs(post_exit_env_vars).current_dir(
state.directories.instances_dir().join(&instance_path),
);
command.spawn().map_err(IOError::from)?;