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

parse() is not awaited in V5 #575

Closed
justinwilaby opened this issue Feb 5, 2025 · 1 comment · Fixed by #576
Closed

parse() is not awaited in V5 #575

justinwilaby opened this issue Feb 5, 2025 · 1 comment · Fixed by #576
Labels
good first issue Good for newcomers help wanted Accepting PRs

Comments

@justinwilaby
Copy link
Contributor

In @oclif/core, the parse function is async since v2 or so but plugins-legacy does not await on this function resulting in destructuring a Promise instead of an object.

 class V5 extends Command {
            async run() {
                const color = require('@oclif/color').default;
                const { args, argv, flags } = this.parse(this.constructor);  // <-------------- this should be awaited
// ... rest of the class

This results in undefined values for args, argv, flags which throws after entering the command's run function.

The fix is const { args, argv, flags } = await this.parse(this.constructor);

Copy link

git2gus bot commented Feb 5, 2025

Git2Gus App is installed but the .git2gus/config.json doesn't exist.

@mdonnalley mdonnalley added help wanted Accepting PRs good first issue Good for newcomers labels Feb 5, 2025
justinwilaby added a commit to justinwilaby/plugin-legacy that referenced this issue Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Accepting PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants