Utils: Add workaround for sdktool

Which is compiled against an older Qt version to keep it more
compatible.

Change-Id: Ifee61a524055ca383c83da9f237e50536a3fd0cb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2020-10-05 14:01:40 +02:00
parent ee3a0ecb75
commit 430a9a03b7

View File

@@ -663,7 +663,13 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments
} else {
if (err != QtcProcess::FoundMeta)
return false;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
*outCmd = qEnvironmentVariable("SHELL", "/bin/sh");
#else
// for sdktool
*outCmd = qEnvironmentVariableIsSet("SHELL") ? QString::fromLocal8Bit(qgetenv("SHELL"))
: QString("/bin/sh");
#endif
*outArgs = Arguments::createUnixArgs(
QStringList({"-c", (quoteArg(command) + ' ' + arguments)}));
}