protected function runGrumPhpCommand($command)
{
$config = $this->composer->getConfig();
$commandLocator = new ExternalCommand($config->get('bin-dir'), new ExecutableFinder());
$executable = $commandLocator->locate('grumphp');
$builder = new ProcessBuilder([$executable, $command, '--no-interaction']);
$process = $builder->getProcess();
// Check executable which is running:
if ($this->io->isVeryVerbose()) {
$this->io->write('Running process : ' . $process->getCommandLine());
}
$process->run();
if (!$process->isSuccessful()) {
$this->io->write('<fg=red>GrumPHP can not sniff your commits. Did you specify the correct git-dir?</fg=red>');
$this->io->write('<fg=red>' . $process->getErrorOutput() . '</fg=red>');
return;
}
$this->io->write('<fg=yellow>' . $process->getOutput() . '</fg=yellow>');
}