Utils: Determine shell from $SHELL instead of hard-coding /bin/sh

Fixes: QTCREATORBUG-24659
Change-Id: Icafc001b681cc76af76b8759a4de84db51146fd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-09-23 12:49:38 +02:00
parent f7201c0c8f
commit 361b5e3530
2 changed files with 2 additions and 2 deletions

View File

@@ -516,7 +516,7 @@ bool ConsoleProcess::start()
" is currently not supported."));
return false;
}
pcmd = QLatin1String("/bin/sh");
pcmd = qEnvironmentVariable("SHELL", "/bin/sh");
pargs = QtcProcess::Arguments::createUnixArgs(
{"-c", (QtcProcess::quoteArg(d->m_commandLine.executable().toString())
+ ' ' + d->m_commandLine.arguments())});

View File

@@ -663,7 +663,7 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments
} else {
if (err != QtcProcess::FoundMeta)
return false;
*outCmd = QLatin1String("/bin/sh");
*outCmd = qEnvironmentVariable("SHELL", "/bin/sh");
*outArgs = Arguments::createUnixArgs(
QStringList({"-c", (quoteArg(command) + ' ' + arguments)}));
}