Feat: recover the complete changelog.md#10
Conversation
a60981a to
8402b76
Compare
8402b76 to
8884e32
Compare
JPeer264
left a comment
There was a problem hiding this comment.
What if a changelog exists (maybe used sgr) and then I forgot to release 2 times with sgr but then I want to recover those missing two. It won't work right?
lib/cli.js
Outdated
| import pkg from '../package.json'; | ||
| import questions from './questions'; | ||
| import tasks from './tasks'; | ||
| import recoverTasks from './recover-tasks/index'; |
| const tagsCount = countGitTags(); | ||
| const tags = taggedCommits({ | ||
| path: cwd, | ||
| lookBehind: tagsCount, |
There was a problem hiding this comment.
I guess it would be more performant if you use Number.POSITIVE_INFINITE
| commit: tag.hash, | ||
| }).date; | ||
|
|
||
| changelogData = `${tag.version} - ${moment(tagDate, 'ddd MMM D HH:mm:ss YYYY Z').format('MMMM, DD YYYY')}\n`; |
There was a problem hiding this comment.
I think we should make a global formating, since it is also here used (just with the moment() param diff):
But if we want to change it at some point there is just one place for it.
| return; | ||
| } | ||
|
|
||
| changelogData = `${changelogData} * ${commitInfo.shortHash} ${commitInfo.message.split('\n')[0]} (${commitInfo.author})\n`; |
There was a problem hiding this comment.
Maybe same here as with the header:
Could be a global function where we pass in the entire commitInfo as param. So we can vary better then (if something changes).
| @@ -0,0 +1,94 @@ | |||
| import fs from 'fs'; | |||
| import fse from 'fs-extra'; | |||
There was a problem hiding this comment.
import fse is not quite needed. You can actually write:
import fs from 'fs-extra';|
@JPeer264 why shouldn't you not be able to recover those two releases? The changelog gets rewritten everytime you hit |
No description provided.