From f2d41b7812c19d69b7c0e4efbc7f8ae76d95f878 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 30 Apr 2019 11:36:39 -0700 Subject: [PATCH] build: fix issues for stable release we fixed in 5-0-x (#18064) * build: fix release notes generation * build: fix bump-version script for stable releases --- script/bump-version.js | 2 +- script/lib/version-utils.js | 2 +- script/prepare-release.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/bump-version.js b/script/bump-version.js index 733169ec773..94dbfd41818 100644 --- a/script/bump-version.js +++ b/script/bump-version.js @@ -144,7 +144,7 @@ async function updateVersionH (components) { const filePath = path.resolve(__dirname, '..', 'atom', 'common', 'atom_version.h') const data = await readFile(filePath, 'utf8') const arr = data.split('\n') - const pre = components.pre != null ? `-${components.pre[0]}.${components.pre[1]}` : null + const pre = components.pre && components.pre.length >= 2 ? `-${components.pre[0]}.${components.pre[1]}` : null arr.forEach((item, idx) => { if (item.includes('#define ATOM_MAJOR_VERSION')) { diff --git a/script/lib/version-utils.js b/script/lib/version-utils.js index afebf2b6a9f..029ce8e2c22 100644 --- a/script/lib/version-utils.js +++ b/script/lib/version-utils.js @@ -32,7 +32,7 @@ const isStable = v => { const makeVersion = (components, delim, pre = preType.NONE) => { let version = [components.major, components.minor, components.patch].join(delim) if (pre === preType.PARTIAL) { - version += `${delim}${components.pre[1]}` + version += `${delim}${components.pre[1] || 0}` } else if (pre === preType.FULL) { version += `-${components.pre[0]}${delim}${components.pre[1]}` } diff --git a/script/prepare-release.js b/script/prepare-release.js index 37406e30b59..7576a8aad7d 100755 --- a/script/prepare-release.js +++ b/script/prepare-release.js @@ -100,7 +100,7 @@ async function createRelease (branchToTarget, isBeta) { } releaseIsPrelease = true } else { - releaseBody = releaseNotes + releaseBody = releaseNotes.text } const release = await octokit.repos.createRelease({