Skip to content

Commit

Permalink
fix: git commit add files to the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocesarato committed Jan 17, 2021
1 parent 5dec89c commit 301184d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@ public static function getTags()
*/
public static function commit($message, $files = [])
{
$message = str_replace('"', "'", $message); // Escape
$command = "git commit -m \"chore(release): {$message}\"";
if (empty($files)) {
$command .= ' -- ' . implode(' ', $files);
foreach ($files as $file) {
system("git add \"{$file}\"");
}
system($command);
$message = str_replace('"', "'", $message); // Escape
system("git commit -m \"chore(release): {$message}\"");
}

/**
Expand Down

0 comments on commit 301184d

Please sign in to comment.