Skip to content
Snippets Groups Projects
Commit dbd9c2a5 authored by jurgenhaas's avatar jurgenhaas
Browse files

Make sure git init was called before any other git command

parent 6857146a
No related branches found
No related tags found
No related merge requests found
......@@ -179,10 +179,20 @@ final class Utils {
return $this;
}
/**
* Make sure that git init was called.
*/
protected static function gitInit() {
if (!file_exists('.git')) {
passthru(escapeshellcmd('git init'));
}
}
/**
* @param string $command
*/
public static function git($command) {
self::gitInit();
passthru(escapeshellcmd('git -c "user.email=composer@lakedrops.com" ' . $command));
}
......@@ -212,6 +222,7 @@ final class Utils {
*/
public static function gitLFS($pattern) {
if (self::$lfsGitPatterns === NULL) {
self::gitInit();
$output = [];
exec('git lfs track', $output);
self::$lfsGitPatterns = implode(PHP_EOL, $output);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment