mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-08 09:55:32 +00:00
This prepares a PR with updated history and version for auto-merge. Any new PRs are merged into HISTORY.md but existing entries are left untouched. Thus, we can tweak wording in HISTORY.md at any time without the effort of figuring out which PRs need to be present manually.
15 lines
575 B
TypeScript
15 lines
575 B
TypeScript
import { readFileSync, writeFileSync } from 'fs';
|
|
|
|
// ------------------------------------------------------------------------------------
|
|
// incrementVersion
|
|
// ------------------------------------------------------------------------------------
|
|
|
|
export const incrementVersion = () => {
|
|
// 1.
|
|
const version = readFileSync('./VERSION.md', 'utf8');
|
|
const triplet = version.split('.');
|
|
const patch = parseInt(triplet[2], 10) + 1;
|
|
const newVersion = `${triplet[0]}.${triplet[1]}.${patch}`;
|
|
writeFileSync('./VERSION.md', newVersion, 'utf8');
|
|
return newVersion;
|
|
};
|