-
-
Notifications
You must be signed in to change notification settings - Fork 55
Yeoman #197
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
Yeoman #197
Conversation
|
@thejameskyle, I can't seem to get travis to run successfully. Any clue? Here's the output from travis. |
|
Well the actual error is below. The problem is that yeoman is trying to execute |
|
Are we going to rename this repo to generator-babel-library or something? |
Yeah, something like that. I might contact the guy who owns
Hmm. Were you able to get this working in your fork? Maybe I'll add a try/catch around it. function getDefaultName() {
var name;
try {
name = npm.whoami();
} catch(e) {}
return name;
} |
👍 |
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.
Didn't want to do a loop over files after a fs.readdir()?
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.
That would work. I just copy-pasted from James' generator. I don't have a strong opinion tbqh. Do you prefer a loop?
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.
Seems more flexible - anyway thats what I did IIRC in generator-babel-node
It would be better if it was a recursive readdir (ls -R), however I didn't see a way to do that at the time
Also proposed it here jamiebuilds#8
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.
👍 will-change
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.
Thoughts james?
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.
tl;dr, yes, but maybe in an iteration.
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.
@megawac why not just this.directory('.');?
|
Other than some of the file names looks good |
|
I was also thinking, would it make sense to add a prompt like project type: |
I got around this using promises Promise.all([gitConfig(), exec('npm whoami').catch(function(e) {
console.error('Error getting npm user name: run `npm login`');
console.error(e);
})])
.then(function(args) {
this.config = args[0];
this.username = trim(args[1][0]);
this._showPrompts(done);
}.bind(this)); |
Ya I plan to do that and a few other things in a future iteration. This is just a first version tho'. |
Ah, cool. I think the try-catch is a bit less ugly, so I'm going to try that first. |
|
SUCCESS. thanks for the help @megawac. |
6e1ab24 to
9b65d73
Compare
|
@megawac I like your simplified copying of files, but I want to stick with the Yeoman conventions for now. I may revisit later. I just want to get this first version merged 4now. |
Resolves #58
package.jsonsdepsfromdevDepsin generator package.json