Skip to content

Commit

Permalink
fix changelog updating
Browse files Browse the repository at this point in the history
  • Loading branch information
outofambit committed Mar 2, 2020
1 parent 8ad2911 commit 68de54f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions script/draft-release/run.ts
Expand Up @@ -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')

Expand Down Expand Up @@ -107,11 +109,11 @@ export async function run(args: ReadonlyArray<string>): Promise<void> {
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")

Expand Down

0 comments on commit 68de54f

Please sign in to comment.