-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(version_tag): add glob support #29
base: master
Are you sure you want to change the base?
feat(version_tag): add glob support #29
Conversation
Hi @damienaicheh do you think it would be possible to include such modification to the plugin? |
Hi, I dont understand your usecase, why matching multiples tags? This plugin was made to generate a package based on a specific version of your git repository |
When we use the command describe, we can use globs to match a pattern. The idea is to allow multiple different versions on the same commit, depending on the client we generate the app for |
By using glob patterns in the version tag, the prefix matcher becomes compatible with the |
@@ -52,8 +53,17 @@ function run() { | |||
originalTag = originalTag.split('\n')[0]; | |||
} | |||
var tag = originalTag.toLowerCase(); | |||
if (tag.startsWith(splitPrefix)) { | |||
var tagSplitted = tag.split(splitPrefix); | |||
var prefixCandidates = Array.from({ length: tag.length }, (_, index) => tag.substring(0, index + 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a part I'm not sure about.
There should be a way of extracting the prefix part using the matcher, better than trying matching the prefix by gradually adding more letters and matching each candidates until it doesn't matches anymore...
Hi @damienaicheh , |
Adding glob(7) support for custom prefixes.
The
git describe
--match
argument uses glob(7) pattern to match the tags.Taking this into account, it could be useful for matching multiple tags using the same matcher :
e.g. using prefix
foo?v
, git can matchfoo_v
foo-v
foo!v
...Which is currently not supported by the extractVersionFromTag.
the chosen package for matching glob patterns is minimatch which is well-known and has been actively developed for more than 10 years