forked from pods-framework/pods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
40 lines (35 loc) · 991 Bytes
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*jshint node: true */
module.exports = function ( grunt ) {
'use strict';
// load all grunt tasks in package.json matching the `grunt-*` pattern
require( 'load-grunt-tasks' )( grunt );
grunt.loadNpmTasks( 'grunt-exec' );
const config = {
pkg : grunt.file.readJSON( 'package.json' ), replace : {
version_readme_txt : {
src : ['readme.txt'], overwrite : true, replacements : [
{
from : /Stable tag: (.*)/, to : "Stable tag: <%= pkg.version %>"
}
]
}, version_init_php : {
src : ['init.php'], overwrite : true, replacements : [
{
from : /Version: (.*)/, to : "Version: <%= pkg.version %>"
},
{
from : /define\( 'PODS_VERSION', '([\.\d\w\-]*)' \);/,
to : "define( 'PODS_VERSION', '<%= pkg.version %>' );"
}
]
}
}
};
// Project configuration.
grunt.initConfig( config );
// dev tasks
grunt.registerTask( 'version_number', [
'replace:version_readme_txt',
'replace:version_init_php'
] );
};