diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php
index <HASH>..<HASH> 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;
Add support for sourcing binaries despite the bin proxy being present, take 2