mirror of
https://github.com/jtheoof/swappy.git
synced 2024-10-26 15:44:47 +03:00
2878474e7c
Mixing C code with Javascript files, what's not to love. Simply run the following line to generate a new standard version: ``` npx standard-version --sign ```
12 lines
367 B
JavaScript
Executable File
12 lines
367 B
JavaScript
Executable File
const projectVersionRegExp = /version: '(?<version>\d+\.\d+\.\d+)',/;
|
|
|
|
module.exports.readVersion = function (contents) {
|
|
const matches = contents.match(projectVersionRegExp);
|
|
|
|
return matches ? matches[1] : "unknown";
|
|
};
|
|
|
|
module.exports.writeVersion = function (_contents, version) {
|
|
return _contents.replace(projectVersionRegExp, `version: '${version}',`);
|
|
};
|