From 24b62a10024f80c83be877e20421d0593b900ba9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 7 Jan 2022 15:04:02 +0100 Subject: [PATCH] Add support for sourcing binaries despite the bin proxy being present, take 2 --- src/Composer/Installer/BinaryInstaller.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index a67976cd0..03bd0839f 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -422,6 +422,15 @@ fi export COMPOSER_BIN_DIR=\$(cd "\${self%[/\\\\]*}" > /dev/null; pwd) +# If bash is sourcing this file, we have to source the target as well +bashSource="\$BASH_SOURCE" +if [ -n "\$bashSource" ]; then + if [ "\$bashSource" != "\$0" ]; then + source "\${dir}/$binFile" "\$@" + return + fi +fi + "\${dir}/$binFile" "\$@" PROXY;