-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathversion.js
More file actions
18 lines (16 loc) · 734 Bytes
/
version.js
File metadata and controls
18 lines (16 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var fs = require('fs');
var path = require('path');
var filename = path.join(__dirname, 'package.json');
var package = JSON.parse(fs.readFileSync(filename));
package.version = package.version.replace(/-?\d+$/, function(value) {
return parseInt(value) + 1;
});
package.main = package.name + '.js',
fs.writeFileSync(filename, JSON.stringify(package, null, ' '));
var bower_filename = path.join(__dirname, 'bower.json');
var bower_package = JSON.parse(fs.readFileSync(bower_filename));
bower_package.name = package.name;
bower_package.description = package.description;
bower_package.keywords = package.keywords;
bower_package.version = package.version;
fs.writeFileSync(bower_filename, JSON.stringify(bower_package, null, ' '));