Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --version #2501

Closed
Closed

Conversation

jamescdavis
Copy link
Contributor

fixes #2431

@@ -130,7 +132,7 @@ export function parseArgv(_argv) {
.usage('$0 [options] [files..]')
.options(specifiedOptions)
.help()
.version();
.version(require('../../package.json').version);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to indicate there is a yargs bug in retrieving the version, perhaps when ESM is present? Is there an active yargs issue for this? I'd prefer it was fixed there. If we are going to add a workaround, we would at least need to comment to explain why it's needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're suspicion is correct!: yargs/yargs#2122

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've verified yargs/yargs#2123 fixes the issue, so hopefully that will go in soon!

@jamescdavis
Copy link
Contributor Author

This is bug in yargs: yargs/yargs#2122

@jamescdavis jamescdavis deleted the fix_version branch May 10, 2022 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executable flag '--version' does not echo correct version
2 participants