Skip to content

Commit

Permalink
only generate changelog for new project
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Feb 14, 2017
1 parent b2a018f commit 5fca5bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -81,6 +81,7 @@
### Minor Changes

- init: [`ec23f36`](https://github.com/egoist/changelog.md/commit/ec23f36)

---

Generated by [changelog.md](https://github.com/egoist/changelog.md)
Generated by [changelog.md](https://github.com/egoist/changelog.md)
12 changes: 8 additions & 4 deletions lib/write.js
Expand Up @@ -15,13 +15,17 @@ module.exports = co.wrap(function * (content) {

if (exists) {
const oldContent = yield fs.readFile(file, 'utf8')
const credit = `---

Generated by [changelog.md](https://github.com/egoist/changelog.md)`
yield fs.writeFile(file, content + oldContent + credit, 'utf8')
yield fs.writeFile(file, content + oldContent, 'utf8')
return true
}

yield fs.writeFile(file, content, 'utf8')
const credit = `
---
Generated by [changelog.md](https://github.com/egoist/changelog.md)
`

yield fs.writeFile(file, content + credit, 'utf8')
return false
})

0 comments on commit 5fca5bf

Please sign in to comment.