From f24750f7b48951ce5ddbcd1660cd3705d20b76d7 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 12 Apr 2022 16:44:45 +0100 Subject: [PATCH] Tools: Command to merge release version update --- packages/tools/release-electron.ts | 4 +++- packages/tools/tool-utils.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/tools/release-electron.ts b/packages/tools/release-electron.ts index b7c80ccc3..4cb1bdd94 100644 --- a/packages/tools/release-electron.ts +++ b/packages/tools/release-electron.ts @@ -1,4 +1,4 @@ -import { execCommand2, githubRelease, gitPullTry, rootDir } from './tool-utils'; +import { execCommand2, gitCurrentBranch, githubRelease, gitPullTry, rootDir } from './tool-utils'; const appDir = `${rootDir}/packages/app-desktop`; @@ -27,10 +27,12 @@ async function main() { console.info('Release options: ', releaseOptions); const release = await githubRelease('joplin', tagName, releaseOptions); + const currentBranch = await gitCurrentBranch(); console.info(`Created GitHub release: ${release.html_url}`); console.info('GitHub release page: https://github.com/laurent22/joplin/releases'); console.info(`To create changelog: node packages/tools/git-changelog.js ${version}`); + console.info(`To merge the version update: git checkout dev && git mergeff ${currentBranch} && git push && git checkout ${currentBranch}`); } main().catch((error) => { diff --git a/packages/tools/tool-utils.ts b/packages/tools/tool-utils.ts index 60fd6ff35..1a706b8cd 100644 --- a/packages/tools/tool-utils.ts +++ b/packages/tools/tool-utils.ts @@ -335,6 +335,11 @@ export async function gitPullTry(ignoreIfNotBranch = true) { } } +export const gitCurrentBranch = async (): Promise => { + const output = await execCommand2('git rev-parse --abbrev-ref HEAD', { quiet: true }); + return output.trim(); +}; + export async function githubUsername(email: string, name: string) { const cache = await loadGitHubUsernameCache(); const cacheKey = `${email}:${name}`;