MCPcopy Create free account
hub / github.com/MultiMC/Launcher / substituteVariables

Method substituteVariables

launcher/launch/LaunchTask.cpp:265–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265QString LaunchTask::substituteVariables(const QString &cmd) const
266{
267 QString out = cmd;
268 auto variables = m_instance->getVariables();
269 for (auto it = variables.begin(); it != variables.end(); ++it)
270 {
271 out.replace("$" + it.key(), it.value());
272 }
273 auto env = QProcessEnvironment::systemEnvironment();
274 for (auto var : env.keys())
275 {
276 out.replace("$" + var, env.value(var));
277 }
278 return out;
279}
280

Callers 2

executeTaskMethod · 0.80
executeTaskMethod · 0.80

Calls 5

keyMethod · 0.80
getVariablesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected