diff --git a/gulpfile.js b/gulpfile.js index 3bc6e1c6..106f6edc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,7 @@ +const VERSION = "2.3.15"; + var gulp = require('gulp'); +var replace = require('gulp-replace'); const libsJs = [ 'node_modules/jquery/dist/jquery.min.js', @@ -21,7 +24,7 @@ const libsCss = [ 'node_modules/node-snackbar/dist/snackbar.min.css', ] -gulp.task('default', function () { +gulp.task('update-libs', function () { libsJs.forEach(libJs => { gulp.src(libJs).pipe(gulp.dest('js/libs')); }); @@ -33,7 +36,18 @@ gulp.task('default', function () { }); }); + +gulp.task('version', function(){ + gulp.src(['package.json', 'package-lock.json']) + .pipe(replace(/"version":\s"\d{1,3}.\d{1,3}.\d{1,3}"/, `"version": "${VERSION}"`)) + .pipe(gulp.dest('.')); + + gulp.src(['manifest.json']) + .pipe(replace(/"version":\s"\d{1,3}.\d{1,3}.\d{1,3}"/, `"version": "${VERSION}"`)) + .pipe(gulp.dest('.')); +}); + // execute for update dependencies: // $ npm update -// $ gulp +// $ gulp update-libs // Execute any scss compiler (pending to do in gulp) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4d77ea2f..66d08099 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tlmanager", - "version": "2.3.14", + "version": "2.3.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 239f36b3..ed5da0a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tlmanager", - "version": "2.3.14", + "version": "2.3.15", "description": "Development tool", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -27,6 +27,7 @@ "sweetalert2": "^8.17.1" }, "devDependencies": { - "gulp": "^4.0.2" + "gulp": "^4.0.2", + "gulp-replace": "^1.0.0" } }