Skip to content

Commit

Permalink
Allow for Cygwin mounted paths in shim script
Browse files Browse the repository at this point in the history
Fixes #153.
  • Loading branch information
HoldYourWaffle authored Nov 21, 2023
1 parent 9612111 commit 4c2ccc5
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,10 +3,16 @@
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
dir=$(cygpath -m "$dir");
cygwin_root=$(cygpath -m /)
php_bin=$(cygpath -m "$(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 4c2ccc5

Please sign in to comment.