-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
24 lines (21 loc) · 888 Bytes
/
gulpfile.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
var gulp = require('gulp');
const fsExtra = require('fs-extra');
const shell = require('shelljs');
gulp.task('publish', function () {
var packageJson = fsExtra.readJsonSync('./package.json');
var version = parseInt(packageJson.version.split('.')[2]);
console.log(`Previous version is ${version.toString()}`);
version = (++version).toString();
console.log(`Current version is ${version.toString()}`);
packageJson.version = packageJson.version.split('.')[0] + '.' + packageJson.version.split('.')[1] + '.' +
version;
fsExtra.writeJsonSync('package.json', packageJson, {
spaces: 2
});
packageJson = fsExtra.readJsonSync('./package.json');
version = parseInt(packageJson.version.split('.')[2]);
console.log(`Updated version is ${version.toString()}`);
// shell.exec('npm publish', {
// silent: false
// });
})