-
Notifications
You must be signed in to change notification settings - Fork 159
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
Fixed missing package name in generated cli.js #132
Conversation
Please add a unit test. We want to make sure this won't break if someone run |
Thanks, I added a basic test that compares whether the name variable contains anything. By the way, seems like |
Checks the presence of package name in lib/cli.js, see issue yeoman#133
ae78e45
to
1272ec7
Compare
|
@@ -21,7 +21,7 @@ module.exports = generators.Base.extend({ | |||
this.fs.copyTpl( | |||
this.templatePath('cli.js'), | |||
this.destinationPath('lib/cli.js'), { | |||
pkgSafeName: _.camelCase(this.options.name), | |||
pkgSafeName: _.camelCase(this.appname), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're not using the --name
anymore, we should remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually using --name
works. I wasn't aware of that, my mistake. I did not provide and it still ran without errors, I guess some check for that might be useful.
edit: it is not mentioned in --help
and I looked there, nevermind I guess this PR can be closed. Thanks for quick help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be close. We have (or should have) access to the app name without requiring someone to manually pass an option.
The interface will be better if we can just figure that value out without user input.
I'm closing this PR since there is a possibility to provide I think two things need to be done:
I will leave the issue open for discussion. Thanks @SBoudrias for the quick feedback. 👍 |
this.options.name
was undefined since CLI generator doesn't have anyname
option specified.