Skip to content

Commit

Permalink
Add option to set custom path to git binary (#3393)
Browse files Browse the repository at this point in the history
* Add option to set custom path to git binary

* words

* style

* Move `binary` config down above `commands` config.

Co-authored-by: Jason Varga <[email protected]>
Co-authored-by: Jesse Leite <[email protected]>
  • Loading branch information
3 people authored Mar 19, 2021
1 parent 9c45697 commit db16c34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions config/git.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@
storage_path('forms'),
],

/*
|--------------------------------------------------------------------------
| Git Binary
|--------------------------------------------------------------------------
|
| By default, Statamic will try to use the "git" command, but you can set
| an absolute path to the git binary if necessary for your environment.
|
*/

'binary' => env('STATAMIC_GIT_BINARY', 'git'),

/*
|--------------------------------------------------------------------------
| Commands
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Processes/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private function runGitCommand(...$parts)
*/
private function prepareProcessArguments($parts)
{
return collect(['git'])
return collect([config('statamic.git.binary')])
->merge($parts)
->flatten()
->reject(function ($part) {
Expand Down

0 comments on commit db16c34

Please sign in to comment.