mirror of
https://github.com/jtheoof/swappy.git
synced 2024-09-11 14:55:49 +03:00
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}',`);
|
|
};
|