mirror of
https://github.com/reconurge/flowsint.git
synced 2026-03-11 17:34:31 -05:00
21 lines
554 B
JavaScript
Executable File
21 lines
554 B
JavaScript
Executable File
/**
|
|
* Custom updater for pyproject.toml
|
|
* Used by standard-version to bump version in pyproject.toml
|
|
*/
|
|
|
|
const stringifyPackage = require('stringify-package');
|
|
const detectIndent = require('detect-indent');
|
|
const detectNewline = require('detect-newline');
|
|
|
|
module.exports.readVersion = function (contents) {
|
|
const match = contents.match(/^version = "(.*)"$/m);
|
|
return match ? match[1] : null;
|
|
};
|
|
|
|
module.exports.writeVersion = function (contents, version) {
|
|
return contents.replace(
|
|
/^version = ".*"$/m,
|
|
`version = "${version}"`
|
|
);
|
|
};
|