Skip to content

Commit

Permalink
Fix "using Windows PHP in Cygwin"-check in shim script
Browse files Browse the repository at this point in the history
Fixes #153.

r
  • Loading branch information
HoldYourWaffle committed Nov 20, 2023
1 parent 9612111 commit 5d7be15
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/shims/composer
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)

if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
cygwin_root=$(cygpath -w /)
php_bin=$(cygpath -w "$(which php)")

case "$php_bin" in
"$cygwin_root"*)
# We are using Cygwin PHP, no action necessary
;;
*)
# We are using Windows PHP, so the path must be translated
dir=$(cygpath -m "$dir");
;;
;;
esac
fi

Expand Down

0 comments on commit 5d7be15

Please sign in to comment.