1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-02 12:47:41 +02:00
joplin/packages/tools/release-plugin-generator.js
2020-11-18 10:36:31 +00:00

31 lines
899 B
JavaScript

const { execCommand, execCommandVerbose, rootDir, gitPullTry } = require('./tool-utils.js');
const genDir = `${rootDir}/packages/generator-joplin`;
async function main() {
process.chdir(genDir);
console.info(`Running from: ${process.cwd()}`);
await gitPullTry();
const version = (await execCommand('npm version patch')).trim();
const tagName = `plugin-generator-${version}`;
console.info(`New version number: ${version}`);
await execCommandVerbose('npm', ['publish']);
await gitPullTry();
await execCommandVerbose('git', ['add', '-A']);
await execCommandVerbose('git', ['commit', '-m', `Plugin Generator release ${version}`]);
await execCommandVerbose('git', ['tag', tagName]);
await execCommandVerbose('git', ['push']);
await execCommandVerbose('git', ['push', '--tags']);
}
main().catch((error) => {
console.error('Fatal error');
console.error(error);
process.exit(1);
});