VersionTasks git queries return empty results
On my machine all the functions such as this return empty string results:
protected function getLastTag()
{
$execResult = $this->_exec('git describe --tags || true');
$gitTagLast = trim($execResult->getMessage());
return $gitTagLast;
}
After some digging I found the following thread: https://github.com/consolidation/Robo/issues/382#issuecomment-974503201
TL;DR: robo only captures the output if the command is not considered successful. I have no idea why this works in CI and Windows environments, but it seems to be the issue here. Thus we should take a look at any commands that capture process output and perhaps add a specific shortcut or at least a switch to _exec()
.
This works fine:
protected function getLastTag()
{
$execResult = $this->taskExec('git describe --tags || true')->printOutput(false)->run();
$gitTagLast = trim($execResult->getMessage());
return $gitTagLast;
}
@c33s any suggestions? Have you stepped into this issue before?
Edited by David Grüner