feat: make interactive default true

main
sudo pacman -Syu 2022-04-23 23:05:22 +07:00
parent 0e55d7724b
commit a7b1281b02
3 changed files with 5 additions and 6 deletions

View File

@ -10,7 +10,7 @@ Tool to generate `CHANGELOG.md`, `CHANGELOG.rst` from [Conventional Commits](htt
## Roadmap
- [ ] Support `CHANGELOG.txt`
- [ ] Interactive mode
- [x] Interactive mode
- [ ] Unit test
## Install

View File

@ -36,8 +36,6 @@ func (a *action) RunGenerate(c *cli.Context) error {
fmt.Printf("Input to (%s):\n", usageTo)
a.flags.to = ioe.ReadInputEmpty()
// TODO: support more flags
}
commits, err := a.getCommits()
@ -149,7 +147,7 @@ func (a *action) generateMarkdownChangelog(output, version string, commits []con
}
// Actually writing to changelog file
if err := os.WriteFile(output, []byte(changelogText), 0644); err != nil {
if err := os.WriteFile(output, []byte(changelogText), 0o644); err != nil {
return fmt.Errorf("failed to write file %s: %w", output, err)
}
@ -181,7 +179,7 @@ func (a *action) generateRSTChangelog(output, version string, commits []conventi
}
// Actually writing to changelog file
if err := os.WriteFile(output, []byte(changelogText), 0644); err != nil {
if err := os.WriteFile(output, []byte(changelogText), 0o644); err != nil {
return fmt.Errorf("failed to write file %s: %w", output, err)
}

View File

@ -36,7 +36,7 @@ const (
usageFilename = "output `FILENAME`"
usageFiletype = "output `FILETYPE`"
usageDryRun = "demo run without actually changing anything"
usageInteractive = "interactive mode"
usageInteractive = "interactive mode, default is true"
)
var (
@ -110,6 +110,7 @@ func NewApp() *App {
Name: flagInteractive,
Usage: usageInteractive,
Aliases: aliasInteractive,
Value: true,
},
},
Action: a.RunGenerate,