mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 01:26:23 +00:00
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:
@@ -116,6 +116,35 @@ const messages = defineMessages({
|
||||
id: 'app.settings.default-instance-options.post-exit-hook.description',
|
||||
defaultMessage: 'Runs after the game closes.',
|
||||
},
|
||||
hookVariablesDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.description',
|
||||
defaultMessage:
|
||||
'Hooks run in the working directory of the instance, with the following variables:',
|
||||
},
|
||||
instanceNameDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.inst-name.description',
|
||||
defaultMessage: '$INST_NAME: The name of the instance',
|
||||
},
|
||||
instanceIdDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.inst-id.description',
|
||||
defaultMessage: "$INST_ID: The name of the instance's folder",
|
||||
},
|
||||
instanceDirDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.inst-dir.description',
|
||||
defaultMessage: "$INST_DIR: The absolute path to the instance's folder",
|
||||
},
|
||||
instanceMcDirDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.inst-mc-dir.description',
|
||||
defaultMessage: '$INST_MC_DIR: An alias for $INST_DIR',
|
||||
},
|
||||
instanceJavaDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.inst-java.description',
|
||||
defaultMessage: '$INST_JAVA: The absolute path to the java binary',
|
||||
},
|
||||
instanceJavaArgsDescription: {
|
||||
id: 'instance.settings.tabs.hooks.variables.inst-java-args.description',
|
||||
defaultMessage: '$INST_JAVA_ARGS: The JVM Arguments provided to the game',
|
||||
},
|
||||
})
|
||||
|
||||
const fetchSettings = await get()
|
||||
@@ -328,6 +357,18 @@ watch(
|
||||
{{ formatMessage(messages.postExitHookDescription) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="m-0 leading-tight">
|
||||
{{ formatMessage(messages.hookVariablesDescription) }}
|
||||
<ul>
|
||||
<li>{{ formatMessage(messages.instanceNameDescription) }}</li>
|
||||
<li>{{ formatMessage(messages.instanceIdDescription) }}</li>
|
||||
<li>{{ formatMessage(messages.instanceDirDescription) }}</li>
|
||||
<li>{{ formatMessage(messages.instanceMcDirDescription) }}</li>
|
||||
<li>{{ formatMessage(messages.instanceJavaDescription) }}</li>
|
||||
<li>{{ formatMessage(messages.instanceJavaArgsDescription) }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user