From 68de54f4db06a758e8f55e3165f2b3eb4fb564f9 Mon Sep 17 00:00:00 2001 From: evelyn masso Date: Thu, 30 Jan 2020 09:39:21 -0500 Subject: [PATCH] fix changelog updating --- script/draft-release/run.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/script/draft-release/run.ts b/script/draft-release/run.ts index 955879c5062..928037994a7 100644 --- a/script/draft-release/run.ts +++ b/script/draft-release/run.ts @@ -12,7 +12,9 @@ import { getNextVersionNumber } from './version' import { execSync } from 'child_process' import { writeFileSync } from 'fs' -const changelog = require('changelog.json') +import { join } from 'path' + +const changelogPath = join(__dirname, '..', '..', 'changelog.json') const jsonStringify: (obj: any) => string = require('json-pretty') @@ -107,11 +109,11 @@ export async function run(args: ReadonlyArray): Promise { console.log(`Set!`) const changelogEntries = await convertToChangelogFormat(lines) - - changelog[nextVersion] = changelogEntries + const changelog = require(changelogPath) + changelog.releases[nextVersion] = changelogEntries // this might throw and that's ok (for now!) - writeFileSync('changelog.json', jsonStringify(changelog)) + writeFileSync(changelogPath, jsonStringify(changelog)) console.log("Here's what you should do next:\n")