forked from danobot/entity-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postbump.js
36 lines (23 loc) · 776 Bytes
/
postbump.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
25
26
27
28
29
30
31
32
33
34
var v = require('./package.json').version
const replace = require('replace-in-file');
const updateJsonFile = require('update-json-file')
const regex = new RegExp('VERSION = .*', 'i');
const options = {
files: 'custom_components/entity_controller/__init__.py',
from: regex,
to: "VERSION = '"+v+"'",
};
var changes = replace.sync(options)
const regex3 = new RegExp('Version: .*', 'i');
const header_version = {
files: 'custom_components/entity_controller/__init__.py',
from: regex3,
to: "Version: v"+v,
};
changes = replace.sync(header_version)
const filePath = 'custom_components/entity_controller/manifest.json'
updateJsonFile(filePath, (data) => {
data.version = v
return data
})
console.log("chore(release): " + v)