split command line args for IndexerCommandCustom usages
* this seems to be required when using the new QProcess API. * this also required to remove quotes that were added to path args because otherwise the Python indexer would mistake absolute paths for relative paths.
This commit is contained in:
@@ -465,9 +465,12 @@ void TaskExecuteCustomCommands::runIndexerCommand(
|
||||
indexedSourceFileCount + 1, indexedSourceFileCount, m_indexerCommandCount, {sourcePath});
|
||||
MessageIndexingStatus(true, indexedSourceFileCount * 100 / m_indexerCommandCount).dispatch();
|
||||
|
||||
const std::wstring command = indexerCommand->getCustomCommand();
|
||||
const std::wstring command = indexerCommand->getCommand();
|
||||
const std::vector<std::wstring> arguments = indexerCommand->getArguments();
|
||||
|
||||
LOG_INFO("Start processing command \"" + utility::encodeToUtf8(command) + "\"");
|
||||
LOG_INFO(
|
||||
"Start processing command \"" +
|
||||
utility::encodeToUtf8(command + L" " + utility::join(arguments, L" ")) + "\"");
|
||||
|
||||
const ErrorCountInfo previousErrorCount = storage ? storage->getErrorCount()
|
||||
: ErrorCountInfo();
|
||||
@@ -475,7 +478,7 @@ void TaskExecuteCustomCommands::runIndexerCommand(
|
||||
LOG_INFO("Starting to index");
|
||||
std::wstring errorMessage;
|
||||
const int result = utility::executeProcessAndGetExitCode(
|
||||
command, {}, m_projectDirectory, -1, true, &errorMessage);
|
||||
command, arguments, m_projectDirectory, -1, true, &errorMessage);
|
||||
LOG_INFO("Finished indexing");
|
||||
|
||||
if (storage)
|
||||
@@ -508,8 +511,9 @@ void TaskExecuteCustomCommands::runIndexerCommand(
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring statusText = L"command \"" + indexerCommand->getCustomCommand() +
|
||||
L"\" returned";
|
||||
std::wstring statusText = L"command \"" + indexerCommand->getCommand() + L" " +
|
||||
utility::join(arguments, L" ") + L"\" returned";
|
||||
|
||||
if (result != 0)
|
||||
{
|
||||
statusText += L" code \"" + std::to_wstring(result) + L"\"";
|
||||
|
||||
Reference in New Issue
Block a user