-
-
Save erikhansen/767891cbec7c459e1799131b53902e90 to your computer and use it in GitHub Desktop.
Composer Notes and Private Repositories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List the composer home directory | |
# Typically /Users/<user>/.composer or /home/<user>/.composer or C:\Users\<user>\AppData\Roaming\Composer | |
echo $COMPOSER_HOME | |
# List files in the composer home | |
ls -la $COMPOSER_HOME | |
# View auth.json in composer home used when no local ./auth.json exists in the directory executed from | |
cat $COMPOSER_HOME/auth.json | |
# View config.json in composer home which is merged with any ./composer.json | |
cat $COMPOSER_HOME/config.json | |
# List all packages from a private repository only by disabling packagist | |
# Check for existance of local composer.json and if it does not exist create one | |
# that will disable packages and specify the repository desired then show all | |
# packages in that repository and cleanup afterwards by removing the composer.json created | |
[[ ! -f composer.json ]] \ | |
&& echo '{"repositories":[{"packagist.org":false},{"type":"composer","url":"https://repo.magento.com/"}]}' > composer.json \ | |
&& composer show magento/* --all \ | |
&& rm composer.json | |
# List package info for a specific package in a private repo | |
[[ ! -f composer.json ]] \ | |
&& echo '{"repositories":[{"packagist.org":false},{"type":"composer","url":"https://repo.magento.com/"}]}' > composer.json \ | |
&& composer info -a magento/project-community-edition \ | |
&& rm composer.json | |
# Get package info from packagist (as long as packagist is not disabled and other repositories are not specified) | |
composer info -a magento/project-community-edition | |
# When comparing the package info between repositories note the source and distribution url differences | |
# There may also be version differences between the same package listed in different repositories |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment