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

aliases for subgenerators #663

Closed
markusfalk opened this issue Sep 24, 2014 · 5 comments
Closed

aliases for subgenerators #663

markusfalk opened this issue Sep 24, 2014 · 5 comments

Comments

@markusfalk
Copy link

I would like to wish for aliases for subgenerators

I have created a subgenerator and gave it a speaking name that is quite long. When using it I would like to type in much less than that.

Example

status quo:

$ yo kickstart:addcomponent <name>

could be shorter with an alias:

$ yo kickstart:ac <name>
@addyosmani addyosmani changed the title aliases for subgenerators aliases for subgenerators Sep 24, 2014
@SBoudrias
Copy link
Member

Right now an easy solution would be to create the ac folder, so that:

// inside ac/index.js
module.exports = require('../addcomponent');

I don't think adding aliases as a functionality is very useful and worthwhile of implementing in the core. If someone else feel otherwise we can discuss it, otherwise I'll close the issue in a couple days. (the previous suggestion will continues to work if you really need aliases)

@SBoudrias
Copy link
Member

I'll close as this is probably not something we'll implement in the future. The workaround explained higher will work if you really want aliases.

@robdodson
Copy link

How would you copy over your templates with the above workaround?

this.copy('foo.html') is now relative to the ac directory and throws an error

@robdodson
Copy link

ah nvm, path.join(__dirname, 'foo.html') will work :)

@SBoudrias
Copy link
Member

You could also manually set the sourceRoot() to the correct folder. See the context section of http://yeoman.io/authoring/file-system.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants