mage2click / docker-magento-mutagen

Mage2click Docker-based development environment for Magento with mutagen.io sync for files on macOS
https://mage2.click
MIT License
69 stars 9 forks source link

Fix Erroneous Composer Prompts #32

Closed davidalger closed 5 years ago

davidalger commented 5 years ago

When working in a sub-directory with no composer.json and where a parent directory has a composer.json file, composer will incorrectly present the following prompt when running composer config -gl:

No composer.json in current directory, do you want to use the one at /Volumes/Server? [Y,n]?

The addition of the -n flag silences this, making composer only look at the global composer auth.json file for the credentials as stipulated by the -g flag.

In addition to adding the -n (non-interactive) flag, I've also cleaned up the composer calls to lookup the creds without use of grep or cut. The || true is there to silence any exit codes (and prevent them from bubbling up) similar to how they would have been silenced when running the output through a pipe. And I've cleaned up the odd wrapping of composer in $() on line 95 since this actually results in the output of composer being executed by sh as a command (resulting in an error).

u-maxx commented 5 years ago

Thanks @davidalger!