0

I've got a make file in which I want to pull in a remote Git repository and only fetch a subdirectory. I've tried as following:

projects[example_module][type] = "module"
projects[example_module][download][type] = "git"
projects[example_module][download][url] = "git@bitbucket.org:team/example_modules.git"
projects[example_module][download][subtree] = "example_module_subdir"

Though, this creates a example_module folder where I expect it to be, though it contains the entire repository. What am I overlooking? Is this impossible? (using Drush 7.0.0)

2 Answers 2

1

The [subtree] only works if the download is an archive. See Project download options page for drush 7.x.

0

If you are working with public repo you can play with the zip file generated by the repository

You need to open the zip file to get the structure of files inside the zip. And reproduce the same structure in the subtree parameter(github for example add a prefix with the tag to the directory inside the zip)

Example

libraries[views_civicrm_documents][destination] = "modules/contrib"
libraries[views_civicrm_documents][directory_name] = "views_civicrm_documents"
libraries[views_civicrm_documents][download][type] = "get"
libraries[views_civicrm_documents][download][url] = "https://github.com/CiviCooP/org.civicoop.documents/archive/refs/tags/v1.2.zip"
libraries[views_civicrm_documents][download][subtree] = "org.civicoop.documents-1.2/drupal/views_civicrm_documents"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.