expand env from wrapped cmd

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
(cherry picked from commit 09a118e85e3646ded9d7b2704d2f95a589ca19b9)
This commit is contained in:
Trial97 2023-11-18 11:18:50 +02:00 committed by github-actions[bot]
parent 43834e2148
commit b7b5630588
3 changed files with 5 additions and 4 deletions

View File

@ -307,7 +307,7 @@ QString expandVariables(const QString& input, QProcessEnvironment dict)
return result; return result;
} }
QString LaunchTask::substituteVariables(QString& cmd) const QString LaunchTask::substituteVariables(QString& cmd, bool isLaunch) const
{ {
return expandVariables(cmd, m_instance->createEnvironment()); return expandVariables(cmd, isLaunch ? m_instance->createLaunchEnvironment() : m_instance->createEnvironment());
} }

View File

@ -87,7 +87,7 @@ class LaunchTask : public Task {
shared_qobject_ptr<LogModel> getLogModel(); shared_qobject_ptr<LogModel> getLogModel();
public: public:
QString substituteVariables(QString& cmd) const; QString substituteVariables(QString& cmd, bool isLaunch = false) const;
QString censorPrivateInfo(QString in); QString censorPrivateInfo(QString in);
protected: /* methods */ protected: /* methods */

View File

@ -131,6 +131,7 @@ void LauncherPartLaunch::executeTask()
QString wrapperCommandStr = instance->getWrapperCommand().trimmed(); QString wrapperCommandStr = instance->getWrapperCommand().trimmed();
if (!wrapperCommandStr.isEmpty()) { if (!wrapperCommandStr.isEmpty()) {
wrapperCommandStr = m_parent->substituteVariables(wrapperCommandStr);
auto wrapperArgs = Commandline::splitArgs(wrapperCommandStr); auto wrapperArgs = Commandline::splitArgs(wrapperCommandStr);
auto wrapperCommand = wrapperArgs.takeFirst(); auto wrapperCommand = wrapperArgs.takeFirst();
auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand); auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand);