-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpostbump.js
57 lines (41 loc) · 1.18 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var v = require('./package.json').version
const replace = require('replace-in-file');
const updateJsonFile = require('update-json-file')
const regex = new RegExp('VERSION = .*', 'i');
let options = {
files: 'custom_components/processor/__init__.py',
from: regex,
to: "VERSION = '"+v+"'",
};
var changes = replace.sync(options)
options = {
files: 'custom_components/processor/mqtt_code.py',
from: regex,
to: "VERSION = '"+v+"'",
};
var changes = replace.sync(options)
options = {
files: 'custom_components/processor/yaml_scheduler.py',
from: regex,
to: "VERSION = '"+v+"'",
};
var changes = replace.sync(options)
options = {
files: 'custom_components/processor/__init__.py',
from: regex,
to: "VERSION = '"+v+"'",
};
var changes = replace.sync(options)
const regex3 = new RegExp('Version: .*', 'i');
const header_version = {
files: 'custom_components/processor/__init__.py',
from: regex3,
to: "Version: v"+v,
};
changes = replace.sync(header_version)
const filePath = 'custom_components/processor/manifest.json'
updateJsonFile(filePath, (data) => {
data.version = v
return data
})
console.log("chore(release): " + v)