-
Notifications
You must be signed in to change notification settings - Fork 122
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
Provide regex/prefixes per file set #131
Comments
While that sounds like it might be good, for your specific use case I would question why you need the version in so many places. If you aren't publishing on npm, then package.json doesn't really need it. Why does the readme need it as well? |
Hi, Versioning is a pain with WordPress themes and plugins. These files are the I want to use the package.json as the unique source for version number in |
+1. I'd like to use grunt-bump in all my projects, but writing a regex to cover all cases is somewhat problematic. |
If someone wants to write up an api and/or help docs for this, it would make it easier to approve and implement |
Hi, I think from the configuration point of view, it could look like that:
Above you can notice the differences:
|
+1 |
@vpratfr Salut Vincent! I'm currently using grunt-version, which works well for version bumps, but it doesn't handle git tag/commit/release/push like grunt-bump does. Below is an example task: bump: {
packageJson: {
options: {
files: ['package.json']
}
},
pluginConstant: {
options: {
regExp: 'define\\(\\s*\'WR_VERSION\',\\s*\'',
files: ['plugin-reviews.php']
}
},
stableTag: {
options: {
regExp: 'Stable tag:\\s+',
files: ['readme.txt']
}
}
}, If you're confident with writing grunt-plugins, then perhaps you can take a look at how Grunt-Version does it. I really wish I could help more, but I far from being a Node JS expert... |
Until this pull request is approved, you can use the improved grunt bump in your package.json like this: |
In WordPress plugin development, the version number is in various files, at least the following:
What happens is that bump does not find the version number in the txt and php files I mentionned.
I can do that with another grunt plugin: https://github.com/kswedberg/grunt-version
You can specify with each file set a prefix. This looks like that for a WordPress plugin:
However, that plugin has its own weaknesses and feels less mature than yours.
Would be great if we could pass this kind of prefix/regex for each fileset in grunt-bump
The text was updated successfully, but these errors were encountered: