Skip to content

Conversation

@ignacioola
Copy link
Contributor

Fixes undefined description message when running react-native init --help on an existing React Native project.

Test Plan:

Run the cli from react-native repo:

> cd react-native
> yarn
> node local-cli/cli.js init --help

And see that the description no longer says undefined

Release Notes:

[CLI][BUGFIX][local-cli/cliEntry.js] - Fix undefined description message when running init cli command help.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 31, 2018
@elicwhite
Copy link
Member

Maybe we should be requiring every command to have a description instead of patching this here.

For reference, this is where commanderjs defines it's help behavior. https://github.com/tj/commander.js/blob/master/index.js#L1083-L1101

cc @grabbou

I'll land this in the mean time though, seems reasonable enough short term patch.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Nov 1, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@TheSavior is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@ignacioola merged commit 58732a8 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Nov 1, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 1, 2018
grabbou pushed a commit to react-native-community/cli that referenced this pull request Nov 6, 2018
Summary:
Fixes `undefined` description message when running `react-native init --help` on an existing React Native project.
Pull Request resolved: facebook/react-native#22045

Differential Revision: D12878956

Pulled By: TheSavior

fbshipit-source-id: ede329ca88a02013a6c2f75f1b762d89eacdb34f
kelset pushed a commit that referenced this pull request Nov 9, 2018
Summary:
Fixes `undefined` description message when running `react-native init --help` on an existing React Native project.
Pull Request resolved: #22045

Differential Revision: D12878956

Pulled By: TheSavior

fbshipit-source-id: ede329ca88a02013a6c2f75f1b762d89eacdb34f
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
@grabbou
Copy link
Contributor

grabbou commented Mar 11, 2019

Interesting @ignacioola - sorry to comment after that amount of time, but it's weird that you have run into this issue.

Description itself is optional and we set noHelp to avoid printing information when it's not provided. See here: https://github.com/react-native-community/react-native-cli/blob/master/packages/cli/src/cliEntry.js#L97

Let's take a closer look here. Maybe noHelp is not working as expected?

@grabbou
Copy link
Contributor

grabbou commented Mar 11, 2019

I am moving this discussion to the CLI repository.

t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Summary:
Fixes `undefined` description message when running `react-native init --help` on an existing React Native project.
Pull Request resolved: facebook#22045

Differential Revision: D12878956

Pulled By: TheSavior

fbshipit-source-id: ede329ca88a02013a6c2f75f1b762d89eacdb34f
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants