Skip to content

Commit e9ad08b

Browse files
committed
refactor(changelog-generator): print banner sooner
So that in the `--dry-run` without `--version` use case, you won't see the "phony version" message before the banner: ``` Using phony version changelog-generator/v0.0.0-placeholder during --dry-run ____________________ (_) ` | | | changelog.js | | ============ | | | | Reporting | | for duty! | | | |__________________| (_)_________________) Fetching remote tags: run with --no-update-tags to skip ``` Note that this does mean that we're showing the banner in some situations where we didn't show it before, but I think that's ok. Example: ``` changelog-generator ❯ bin/liferay-changelog-generator.js --invalid-option ____________________ (_) ` | | | changelog.js | | ============ | | | | Reporting | | for duty! | | | |__________________| (_)_________________) error: Unrecognized argument --invalid-option; see --help for available options error: Missing required option: --version; see --help for usage zsh: exit 1 bin/liferay-changelog-generator.js --invalid-option ```
1 parent 65a37c4 commit e9ad08b

File tree

1 file changed

+8
-7
lines changed
  • projects/npm-tools/packages/changelog-generator/src

1 file changed

+8
-7
lines changed

projects/npm-tools/packages/changelog-generator/src/index.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,6 @@ async function getVersionTagPrefix() {
702702
}
703703

704704
async function main(_node, _script, ...args) {
705-
const options = await parseArgs(args);
706-
707-
if (!options) {
708-
process.exit(1);
709-
}
710-
const {outfile, to, updateTags} = options;
711-
712705
printBanner(`
713706
changelog.js
714707
============
@@ -717,6 +710,14 @@ async function main(_node, _script, ...args) {
717710
for duty!
718711
`);
719712

713+
const options = await parseArgs(args);
714+
715+
if (!options) {
716+
process.exit(1);
717+
}
718+
719+
const {outfile, to, updateTags} = options;
720+
720721
if (updateTags) {
721722
try {
722723
info('Fetching remote tags: run with --no-update-tags to skip');

0 commit comments

Comments
 (0)