packages/tools/release-cli.js
// to specify from where the changelog should be created
to specify from where the changelog should be created
to specify from where the changelog should be created
async function main() {
	process.chdir(appDir);
	const newVersion = (await execCommand('npm version patch')).trim();
	console.info(`Building ${newVersion}...`);
	const newTag = `cli-${newVersion}`;
	await execCommand('git pull');
	await execCommand('touch app/main.js');
	await execCommand('npm run build');
	await execCommand('cp ../../README.md build/');
	process.chdir(`${appDir}/build`);
	await execCommand('npm publish');
	const changelog = (await execCommand(`node ${rootDir}/packages/tools/git-changelog ${newTag}`)).trim();
	const newChangelog = await insertChangelog(newTag, changelog);
	await fs.writeFile(changelogPath, newChangelog);
	const defaultEditor = (await execCommand('echo $EDITOR')).trim();
	const finalCmds = [
		'git pull',
		'git add -A',
		`git commit -m "CLI ${newVersion}"`,
		`git tag "cli-${newVersion}"`,
		'git push',
		'git push --tags',
	];
	console.info('');
	console.info('Verify that the changelog is correct:');
	console.info('');
	console.info(`${defaultEditor} "${changelogPath}"`);
	console.info('');
	console.info('Then run these commands:');
	console.info('');
	console.info(finalCmds.join(' && '));
}
async function main ( ) { process . chdir ( appDir ) ; const newVersion = ( await execCommand ( 'npm version patch' ) ) . trim ( ) ; console . info ( ` ${ newVersion } ` ) ; const newTag = ` ${ newVersion } ` ; await execCommand ( 'git pull' ) ; await execCommand ( 'touch app/main.js' ) ; await execCommand ( 'npm run build' ) ; await execCommand ( 'cp ../../README.md build/' ) ; process . chdir ( ` ${ appDir } ` ) ; await execCommand ( 'npm publish' ) ; const changelog = ( await execCommand ( ` ${ rootDir } ${ newTag } ` ) ) . trim ( ) ; const newChangelog = await insertChangelog ( newTag , changelog ) ; await fs . writeFile ( changelogPath , newChangelog ) ; const defaultEditor = ( await execCommand ( 'echo $EDITOR' ) ) . trim ( ) ; const finalCmds = [ 'git pull' , 'git add -A' , ` ${ newVersion } ` , ` ${ newVersion } ` , 'git push' , 'git push --tags' , ] ; console . info ( '' ) ; console . info ( 'Verify that the changelog is correct:' ) ; console . info ( '' ) ; console . info ( ` ${ defaultEditor } ${ changelogPath } ` ) ; console . info ( '' ) ; console . info ( 'Then run these commands:' ) ; console . info ( '' ) ; console . info ( finalCmds . join ( ' && ' ) ) ; }
to specify from where the changelog should be created
to specify from where the changelog should be created