Issue
I added mypackage to the repositories key in composer.json:
"repositories": {
    "packagist": {
        "type": "composer",
        "url": "https://packages.drupal.org/8"
    },
    "mypackage": {
        "type": "package",
        "package": {
            "name": "company_name/mypackage",
            "type": "drupal-module",
            "version": "dev-master",
            "source": {
                "type": "git",
                "url": "https://github.com/company_name/mypackage",
                "reference": "master"
            }
        }
    }
},
I run composer require company_name/mypackage-master --prefer-dist
The package does get downloaded but it still adds the .git directory. I would like the package to download without the .git directory. How would I accomplish this? I only have a master branch and no releases in github.
Solution
Posted issue in composer issues here. To fix the issue I did the following:
Add
composer.jsonfile to my package:{"name": "company_name/mymodule", "type": "drupal-custom-module", "description": "My description", "keywords": ["Drupal"], "license": "GPL-2.0+", "homepage": "https://github.com/company_name/mymodule", "support": { "issues": "https://github.com/company_name/mymodule/issues", "source": "https://github.com/company_name/mymodule" }, "require": { }}Update repositories to in
composer.jsonfile (not the modulecomposer.jsonfile)"repositories": { "drupal-packagist": { "type": "composer", "url": "https://packages.drupal.org/8" }, "my-package": { "type": "vcs", "url": "https://github.com/company_name/mypackage" }},Run
composer require company_name/mymodule --prefer-dist.
Answered By - albertski
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.