From 268525269bad110397b60522278d4e278ef0d7a2 Mon Sep 17 00:00:00 2001 From: Gautier P Date: Fri, 26 Mar 2021 16:05:12 +0100 Subject: [PATCH] Watch Changelog changes in gulp --- gulpfile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 503ca3b..b34c187 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -80,6 +80,7 @@ var paths = { .concat('css/*.css'), images: mainNpmFiles().filter((f) => RegExp('.*.+(png|gif|svg)', 'i').test(f)), fonts: mainNpmFiles().filter((f) => RegExp('font-awesome/fonts/.*', 'i').test(f)), + changelog: 'CHANGELOG.md', locales: 'locales/*.json', layers: 'layers/**/*.geojson', layersDestName: 'layers.js', @@ -188,7 +189,7 @@ gulp.task('boundaries', function () { }); gulp.task('changelog', function (cb) { - var content = 'BR.changelog = `' + marked(fs.readFileSync('./CHANGELOG.md', 'utf-8')) + '`'; + var content = 'BR.changelog = `' + marked(fs.readFileSync(paths.changelog, 'utf-8')) + '`'; content = content.replace(//i, ''); fs.writeFile(paths.dest + '/changelog.js', content, cb); }); @@ -207,6 +208,7 @@ gulp.task('watch', function () { remember.forget('scripts', event.path); } }); + gulp.watch(paths.changelog, gulp.series('changelog', 'reload')); gulp.watch(paths.locales, gulp.series('locales', 'reload')); gulp.watch(paths.styles, gulp.series('styles', 'reload')); gulp.watch(paths.layersConfig, gulp.series('layers_config', 'reload'));