mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
15 lines
579 B
TypeScript
15 lines
579 B
TypeScript
import { readFileSync, writeFileSync } from 'node: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;
|
|
};
|