Does it support WordPress themes and plugins?
geminorum opened this issue · 3 comments
geminorum commented
stephenlacy commented
This will bump any text file, for the variable use a custom regex
geminorum commented
-
after testing, It works fine on WordPress theme/plugin files.
-
for constants, I recommend this:
gulp.task('bump:constant', function(){
return gulp.src('./myplugin.php')
.pipe(bump({
regex: new RegExp( "([<|\'|\"]?MY_PLUGIN_VERSION[>|\'|\"]?[ ]*[:=,]?[ ]*[\'|\"]?[a-z]?)(\\d+\\.\\d+\\.\\d+)(-[0-9A-Za-z\.-]+)?([\'|\"|<]?)", "i" ),
}))
.pipe(gulp.dest('.'));
});
it's the same regex from bump-regex
, I've just added comma to the delimiter char set.
stephenlacy commented
Do you want to send a pr with that example to the examples folder/gulpfile?