Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions scripts/install-composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ fi
# Remove the setup script
php -r "unlink('/tmp/composer-setup.php');"

# Check if anything is installed globally
if [ -f /var/www/.composer/composer.json ]; then
# If this is version 2 then let's make sure hirak/prestissimo is removed
if composer --version 2>/dev/null | grep -E "Composer (version )?2." > /dev/null; then
composer global remove hirak/prestissimo
# If upgrading from Composer 1 to 2, remove the prestissimo plugin
# which is incompatible with Composer 2 (parallel downloads are built-in now).
# Use COMPOSER_HOME to find the right global composer.json for the current user.
COMPOSER_HOME="${COMPOSER_HOME:-$(composer global config home --quiet 2>/dev/null || echo '')}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--quiet flag suppresses composer config home value output

Medium Severity

The --quiet flag on composer global config home --quiet suppresses all standard output, including the config value itself. Composer uses Symfony Console, where --quiet sets verbosity to VERBOSITY_QUIET, causing write() to return without printing. This means the subcommand always produces empty output when COMPOSER_HOME isn't already set, so the fallback detection never works and the prestissimo removal block is silently skipped. Removing --quiet while keeping 2>/dev/null would suppress stderr warnings without losing the actual value on stdout.

Fix in Cursor Fix in Web

if [ -n "$COMPOSER_HOME" ] && [ -f "$COMPOSER_HOME/composer.json" ]; then
if composer --version 2>/dev/null | grep -qE "Composer (version )?2\."; then
composer global remove hirak/prestissimo 2>/dev/null || true
fi
fi
Loading