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: improve cli interface #162

Merged
merged 4 commits into from
Feb 13, 2019
Merged

fix: improve cli interface #162

merged 4 commits into from
Feb 13, 2019

Conversation

grabbou
Copy link
Member

@grabbou grabbou commented Feb 13, 2019

Summary:

This fixes few of the issues that I've encountered working in a React Native repository.

When you pass a wrong command or provide no command at all (say, you want to print --help) and your CLI works by setting --projectRoot or --reactNativePath (in React Native repository, this is a must), you end up with a "Unrecognised option" error.

This PR changes that, so that it works and is accepted.

It also fixes a missing path to a inited application that is a regression introduced in 72c3dd4#diff-d9b7abe65a1a1a0e0b19ec93292008eaR16. We wrongly assumed process.cwd() remains the directory the command has been run from. Turns out, it's modified by the init script.

@thymikee thymikee changed the title Feat/improve cli interface feat: improve cli interface Feb 13, 2019
@thymikee thymikee changed the title feat: improve cli interface fix: improve cli interface Feb 13, 2019
}

if (!commander.args.length) {
commander.help();
if (typeof command === 'string') {
Copy link
Member

Choose a reason for hiding this comment

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

this could be else clause to be more explicit :)

@grabbou grabbou merged commit dee16f3 into master Feb 13, 2019
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.

2 participants