Skip to content
Permalink
Browse files

Add marp-team common script for bumping version

  • Loading branch information...
yhatt committed Feb 12, 2019
1 parent 41f61a6 commit f03092767ac98413173a4c736a9f507c88e859e0
Showing with 24 additions and 0 deletions.
  1. +24 −0 version.js
@@ -0,0 +1,24 @@
/* marp-team common script for bumping version.
*
* Usage in package.json:
* {
* "scripts": {
* "version": "curl https://raw.githubusercontent.com/marp-team/marp/master/version.js | node && git add -A CHANGELOG.md"
* }
* }
*/

const fs = require('fs')
const path = require('path')

const unreleased = '## [Unreleased]'
const [date] = new Date().toISOString().split('T')
const version = `## v${process.env.npm_package_version} - ${date}`

const changelog = path.resolve(__dirname, 'CHANGELOG.md')
const content = fs.readFileSync(changelog, 'utf8')

fs.writeFileSync(
changelog,
content.replace(unreleased, `${unreleased}\n\n${version}`)
)

0 comments on commit f030927

Please sign in to comment.
You can’t perform that action at this time.