Skip to content

Commit

Permalink
fix: export 2 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
hunghg255 committed Aug 16, 2023
1 parent 33ab4ca commit abc3fc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Generate changelog for GitHub releases from [Conventional Commits](https://www.c
- List contributors
- Support `--dry` mode to preview the changelog
- Support `--all` mode to write to a file
- Support `--from` and `--to` mode to write to a file between two tags

## Usage

Expand Down Expand Up @@ -64,3 +65,10 @@ npx changeloggithub@latest --dry
```bash
npx changeloggithub@latest --all true
```

## Write to a file between two tags


```bash
npx changeloggithub@latest --from v1.0.0 --to v2.0.0 --output changelog-v2.0.0.md
```
5 changes: 5 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ cli
return
}

if (config.output) {
await fs.writeFile(config.output || 'CHANGELOG.md', md, 'utf-8')
console.log(yellow(`Saved to ${config.output || 'CHANGELOG.md'}`))
return
}

if (!config.token) {
console.error(red('No GitHub token found, specify it via GITHUB_TOKEN env. Release skipped.'))
Expand Down

0 comments on commit abc3fc5

Please sign in to comment.