drupal-composer / drupal-packagist

:package: Drupal Packagist server to automatically build package information from projects on drupal.org
http://packagist.drupal-composer.org
28 stars 4 forks source link

How to avoid creating .git directories when adding dev versions as dependencies? #50

Closed ptmkenny closed 7 years ago

ptmkenny commented 8 years ago

Hey, I just started using Drupal Packagist today and it's awesome. I was able to get all the dependencies of my site into composer.json (https://drupal.stackexchange.com/questions/181754/how-to-use-composer-for-module-dependency/191589#191589), but when I run composer update, I notice that for any module that specifies a dev version, it clones it and leaves a .git directory.

I'm using Pantheon to host my site, so I need to commit the modules downloaded by composer and then push them to Pantheon-- but Pantheon complains about the dev versions of modules having .git directories. Is there a way to configure composer.json so that the .git directories aren't created? If not, do you have any suggestions for handling this (automatically removing the .git directories)?

derhasi commented 8 years ago

In our projects we use a custom build.sh for that. We might replace that with a call to composer archive and/or phing in the future.

ptmkenny commented 8 years ago

Ok, thanks. I tried calling composer archive like this but the .git directories still appear:


  "archive": {
    "exclude": ["/.git", ".git", "/*.git", "/modules/*/.git"]
  },

So, instead, I added the .git directories to the gitignore:

/modules/*/.git