Closed h1nds1ght closed 2 years ago
It's certainly possible, the library picking up 91041
in the first place is unintended behaviour with the regex trying to automatically detect version numbers from the URL.
If a specific version is required, then the user may provide a detailed definition instead like this:
"drupal-libraries": {
"chosen": {
"url": "https://github.com/harvesthq/chosen/archive/91041bc9dd6867f9a1668050a1b092d92027f13b.zip"
"version": "91041bc"
}
}
That being said, I'm not sure what the side effect of putting a non-numeric value as a composer version could cause, happy to take in a PR with tests if there's no documented side effect of making the switch.
But since it's a superficial change, I'm leaning towards not implementing this as there's a known workaround for users who require the short hash behaviour.
Under https://github.com/zodiacmedia/drupal-libraries-installer#alternate-method you describe an alternative way to include a library if it has no tags.
To mitigate against this issue, you should always download a specific commit version rather than from a branch like master
Now, if you do this and insert a specific commit in drupal-libraries, i.e.
and perform a
composer install
, actually the following is displayed:In this case I would expect that the short hash of this commit
91041bc
is displayed.Would it be possible to detect the sha1 i.e. with a regex and then display the short hash when performing a composer install?