Skip to content

Commit

Permalink
Merge pull request #3 from zVPS/netresearch-master
Browse files Browse the repository at this point in the history
Fix for windows in git for windows batch not able to detect executable
  • Loading branch information
Caffe1neAdd1ct authored Aug 9, 2021
2 parents ae0ddb7 + 559e55e commit faf9595
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Netresearch/Composer/Patches/Patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ protected function whichPatchCmd()
if (!$patchCommand) {
$exitCode = $output = null;
$patchCommand = exec('which patch', $output, $exitCode);
if (0 !== $exitCode || !is_executable($patchCommand)) {
$isWin = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
if (0 !== $exitCode || (!$isWin && !is_executable($patchCommand))) {
throw new Exception(
"Cannot find the 'patch' executable command - "
. "use your o/s package manager like 'sudo yum install patch'"
Expand Down

0 comments on commit faf9595

Please sign in to comment.