Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | const gulp = require('gulp') |
||
6 | module.exports = function (config) { |
||
7 | gulp.task('replaceVersion', function (cb) { |
||
8 | try { |
||
9 | // read current version from package.json |
||
10 | config.replaceVersion.php.to = pjson.version |
||
11 | gutil.log(`Replacing ${config.replaceVersion.php.from} with ${config.replaceVersion.php.to} in all PHP files.`) |
||
12 | replace.sync(config.replaceVersion.php) |
||
13 | |||
14 | // replace WordPress theme version in style.css |
||
15 | gutil.log('Updating WordPress theme version.') |
||
16 | config.replaceVersion.wordpress.to += pjson.version |
||
17 | replace.sync(config.replaceVersion.wordpress) |
||
18 | } catch (error) { |
||
19 | gutil.error('Error occurred:', error) |
||
20 | } |
||
21 | cb() |
||
22 | }) |
||
23 | } |
||
24 |