Download Magento module zip with auth.

Language: Shell/Bash.
Author: Kaiss Bouali
Comments: 0
Useful:

Code:

Details:

Your Ad Here

Solution:

To download the zip file that Composer uses to install a particular package, you can try the following steps:

1. Go to the root directory of your Magento installation.

2. Open your `composer.json` file, and look for the package you want to download.

3. Find the package's `dist` URL under the `package` section. For example, it may look something like this:

json
{
"require": {
"vendor/package": "1.0.0"
},
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"extra": {
"magento-deploy-strategy": "copy",
"magento-force": true
},
"config": {
"preferred-install": "dist"
},
"package": {
"dist": {
"url": "https://repo.magento.com/archives/vendor/package/package-1.0.0.0.zip",
"type": "zip"
}
}
}
4. Copy the `url` of the `dist` section.

5. Open your terminal or command-line interface and execute the following command, pasting the `url` you copied into the command:
bash
composer archive --format=zip --no-ansi --no-dev --no-interaction --dir=/tmp my_packages vendor/package 1.0.0
This command will download the zip file of the package and store it in the specified directory.

If authentication is required, Composer will use the credentials provided in the `auth.json` file.

After following these steps, you should have a copy of the zip file that Composer used to install the package.


Comments:

Login to leave your comments!