davidrjonas / composer-lock-diff

See what has changed after a composer update
MIT License
276 stars 18 forks source link

Doesn't work under Git Bash (MINGW64) #40

Open Bilge opened 1 year ago

Bilge commented 1 year ago

composer-lock-diff

The system cannot find the path specified. The system cannot find the path specified. 'git --version' exited with non-zero code '1' 'svn --version' exited with non-zero code '1' No loaders were found; perhaps your vcs cli tools are not installed, not in PATH, or otherwise unavailable

which git

/mingw64/bin/git

git --version

git version 2.38.0.windows.1

davidrjonas commented 1 year ago

Git is run in a Bourne Shell (sh) like this:

exec('sh -c "git --version" > /dev/null 2>&1', $_out, $exit);

If your mingw64 doesn't have sh in the path that'll be a problem. You can test with the following,

<?php
exec('sh -c "git --version" 2>&1', $out, $exit);
var_dump($out);
var_dump($exit);

Good output looks like this:

array(1) {
  [0]=>
  string(18) "git version 2.37.3"
}
int(0)
Bilge commented 1 year ago
$ php test.php
C:\test.php:3:
array(1) {
  [0] =>
  string(28) "git version 2.38.0.windows.1"
}
C:\test.php:4:
int(0)
staabm commented 1 year ago

also ran over this problem with the latest version