app generator fails when trying to get git name
vongohren opened this issue · 9 comments
/usr/local/lib/node_modules/generator-hubot/generators/app/index.js:72
var userName = this.user.git.name();
^
TypeError: Property 'name' of object # is not a function
at Base.yeoman.generators.Base.extend.prompting.askFor (/usr/local/lib/node_modules/generator-hubot/generators/app/index.js:72:36)
at /usr/local/lib/node_modules/generator-hubot/node_modules/yeoman-generator/lib/base.js:381:14
at processImmediate as _immediateCallback
I recieve this error when yo hubot.
But after iv removed the parenthasis after name and email, it works for me. Any reason for that?
Hmm, that's an interseting one.
this.user.git.name()
is from the yeoman api: http://yeoman.github.io/generator/user.html . It's supposed to return the name you've configured for git.
But after iv removed the parenthasis after name and email, it works for me. Any reason for that?
When you do this, what does the generator suggest you use as your the owner name? I have a feeling it's either going to be blank or say undefined. That probably makes sense if you haven't configured git, so we should make sure those are defined before trying to access.
It seemed to work and suggested the right things for me.
It was the right name and email. But you mean config, as in git config user.email?
That's pretty weird. Can you check what version of yo and yeoman you have installed? I wonder if you are on an older/newer version whose API changed.
But you mean config, as in git config user.email?
Yep, exactly that.
Its 1.3.3, just installed it for this case.
I have yo 1.3.3 also, so and I don't see the problem 😓 I was thinking it could be a different dependency, but generator-hubot's only yeoman dependency is yeoman-generator, and it's exact:
"yeoman-generator": "^0.17.0",
So, I can't reproduce this, but I can add an edge-case to support them just in case.
@Snorlock I release generator-hubot@0.2.4 with a fix for this if you want to give that a try.
I will check when im back from India
I can confirm it works now! Sweet!
Closing, thanks for confirming!