Skip to content

Commit

Permalink
fix(git): format option quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Cesarato committed Jan 21, 2021
1 parent 4d90f1d commit 693860b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Helper/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected static function shellExec($string): string
{
$value = shell_exec($string);

return Format::clean($value);
return Format::clean((string)$value);
}

/**
Expand All @@ -39,7 +39,7 @@ public static function getLastTag(): string
*/
public static function getCommitDate($hash): string
{
$date = self::shellExec("git log -1 --format=%aI {$hash}");
$date = self::shellExec("git log -1 --format='%aI' {$hash}");
$today = new DateTime($date);

return $today->format('Y-m-d');
Expand Down Expand Up @@ -72,7 +72,7 @@ public static function getRemoteUrl(): string
*/
public static function getCommits(string $options = ''): array
{
$commits = self::shellExec("git log --format=%B%H----DELIMITER---- {$options}") . "\n";
$commits = self::shellExec("git log --format='%B%H----DELIMITER----' {$options}") . "\n";
$commitsArray = explode("----DELIMITER----\n", $commits);
array_pop($commitsArray);

Expand All @@ -84,7 +84,7 @@ public static function getCommits(string $options = ''): array
*/
public static function getTags(): array
{
$tags = self::shellExec('git tag --list --format=%(refname:strip=2)----DELIMITER----') . "\n";
$tags = self::shellExec("git tag --list --format='%(refname:strip=2)----DELIMITER----'") . "\n";
$tagsArray = explode("----DELIMITER----\n", $tags);
array_pop($tagsArray);

Expand Down

0 comments on commit 693860b

Please sign in to comment.