1
0
Fork 0

Resolve binary realpath to make sure symlinking bin proxies works, refs jakzal/phpqa#336

pull/10409/head
Jordi Boggiano 2021-12-30 21:49:20 +01:00
parent d1d5d75c5f
commit 390260c6a6
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 8 additions and 2 deletions

View File

@ -392,7 +392,13 @@ PROXY;
return <<<PROXY return <<<PROXY
#!/usr/bin/env sh #!/usr/bin/env sh
dir=\$(cd "\${0%[/\\\\]*}" > /dev/null; cd $binDir && pwd) self=\$(realpath \$0)
if [ -z "\$self" ]
then
self="\$0"
fi
dir=\$(cd "\${self%[/\\\\]*}" > /dev/null; cd $binDir && pwd)
if [ -d /proc/cygdrive ]; then if [ -d /proc/cygdrive ]; then
case \$(which php) in case \$(which php) in
@ -403,7 +409,7 @@ if [ -d /proc/cygdrive ]; then
esac esac
fi fi
export COMPOSER_BIN_DIR=\$(cd "\${0%[/\\\\]*}" > /dev/null; pwd) export COMPOSER_BIN_DIR=\$(cd "\${self%[/\\\\]*}" > /dev/null; pwd)
"\${dir}/$binFile" "\$@" "\${dir}/$binFile" "\$@"