1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-30 08:26:59 +02:00
joplin/packages/tools/release-server.ts

29 lines
930 B
TypeScript
Raw Normal View History

import { execCommand2, rootDir, gitPullTry, completeReleaseWithChangelog } from './tool-utils';
2021-01-04 17:01:45 +02:00
const serverDir = `${rootDir}/packages/server`;
async function main() {
2021-09-29 17:49:59 +02:00
// const argv = require('yargs').argv;
// if (!['release', 'prerelease'].includes(argv.type)) throw new Error('Must specify release type. Either --type=release or --type=prerelease');
// const isPreRelease = argv.type === 'prerelease';
2021-09-29 18:55:54 +02:00
// const isPreRelease = false;
2021-05-14 17:17:02 +02:00
2021-01-04 17:01:45 +02:00
await gitPullTry();
process.chdir(serverDir);
const version = (await execCommand2('npm version patch')).trim();
2021-09-29 18:55:54 +02:00
const versionSuffix = ''; // isPreRelease ? '-beta' : '';
const tagName = `server-${version}${versionSuffix}`;
2021-01-04 17:01:45 +02:00
const changelogPath = `${rootDir}/readme/changelog_server.md`;
2021-09-29 18:55:54 +02:00
await completeReleaseWithChangelog(changelogPath, version, tagName, 'Server', false);
2021-01-04 17:01:45 +02:00
}
main().catch((error) => {
console.error('Fatal error');
console.error(error);
process.exit(1);
});