Skip to content

Commit

Permalink
fix: add git command exists check
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Cesarato committed Apr 15, 2021
1 parent ea8fb7e commit 9ecd9eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/DefaultCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ConventionalChangelog;

use ConventionalChangelog\Helper\ShellCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -86,6 +87,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$outputStyle = new SymfonyStyle($input, $output);

if (!ShellCommand::exists('git')) {
$outputStyle->error('It looks like Git is not installed on your system. Please check how install it from https://git-scm.com before run this command.');

return 1; //Command::FAILURE;
}

// Retrieve configuration settings
$config = $input->getOption('config');
if (!empty($config) && is_file($config)) {
Expand Down

0 comments on commit 9ecd9eb

Please sign in to comment.