-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
.versionrc.js
45 lines (40 loc) · 1.13 KB
/
.versionrc.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
const version_updater_regex = {
readVersion: function (contents) {
version_m = contents.match(this.regex);
if (!version_m)
throw new Error("Cannot parse version!");
return version_m[1];
},
writeVersion: function (contents, version) {
new_version = this.regex_repl.replace("$1", version);
return contents.replace(this.regex, new_version);
}
}
let version_updater_poetry = {...version_updater_regex};
version_updater_poetry.regex = /^version = \"([^\"]+)\"$/m;
version_updater_poetry.regex_repl = "version = \"$1\"";
let version_updater_python = {...version_updater_regex};
version_updater_python.regex = /^__version__ = \"([^\"]+)\"$/m;
version_updater_python.regex_repl = "__version__ = \"$1\"";
let packageFiles = [
{
filename: "pyproject.toml",
updater: version_updater_poetry,
}
]
let bumpFiles = packageFiles.concat([
{
filename: "evernote_backup/version.py",
updater: version_updater_python,
}
])
module.exports = {
tagPrefix: "",
header: "",
sign: true,
packageFiles: packageFiles,
bumpFiles: bumpFiles,
scripts: {
postchangelog: "poetry run mdformat CHANGELOG.md"
}
}