Skip to content

Commit

Permalink
feature: changelog-io: regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Apr 28, 2024
1 parent 2f2fca9 commit b50a1fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/build-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import rendy from 'rendy';

const gitTemplate = [
'git log {{ version }}..HEAD --pretty=format:"- %h %s"',
'--grep "{{ category }}("',
'--grep "{{ category }}: "',
'--grep "^{{ category }}("',
'--grep "^{{ category }}: "',
'|',
'sed "s/{{ category }}(/(/g"',
'sed "s/{{ category }}(/(/"',
'|',
'sed "s/{{ category }}: //g"',
'sed "s/{{ category }}: //"',
].join(' ');

export default (category, version) => {
Expand Down
6 changes: 3 additions & 3 deletions lib/build-command.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ test('changelog: build-command', (t) => {
const result = buildCommand('fix', 'v1.0.0');
const expected = [
'git log v1.0.0..HEAD --pretty=format:"- %h %s"',
'--grep "fix(" --grep "fix: "',
'--grep "^fix(" --grep "^fix: "',
'|',
'sed "s/fix(/(/g"',
'sed "s/fix(/(/"',
'|',
'sed "s/fix: //g"',
'sed "s/fix: //"',
].join(' ');

t.equal(result, expected);
Expand Down
2 changes: 2 additions & 0 deletions lib/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export default (versionNew, overrides) => {
}
}

console.log(data);

if (!data)
throw Error(`No new 'feature' and 'fix' commits from ${version}`);

Expand Down

0 comments on commit b50a1fb

Please sign in to comment.