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

Ignore yo-rc for subgenerator #947

Closed
ghost opened this issue Jun 21, 2016 · 4 comments
Closed

Ignore yo-rc for subgenerator #947

ghost opened this issue Jun 21, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 21, 2016

I can't ignore yo-rc root folder when I am running a subgenerator that should create files in the cwd.

I have a generator that uses a yo-rc file for a couple of subgenerators, but now I am trying to make a new subgenerator that must create the files in the CWD.

I tried to use process.cwd() but it's overwritten by yo-rc's path.

Is it possible to make a subgenerator blocks process.cwd from being overwritten?

@SBoudrias
Copy link
Member

So this is currently not an option.

As a workaround, I'd suggest maybe taking the component you want to generate the files in as argument. e.g. yo gen:sub route1

@ghost
Copy link
Author

ghost commented Jun 21, 2016

Ok @SBoudrias, thanks for the reply!

I will pass it as an argument as you said.

@ericmorand
Copy link

ericmorand commented Nov 27, 2016

So that's it? This is not an option?

What's the point of having the CWD changed by Yeoman? What are the benefits of this feature? What if we don't want to force our users to type long arguments when they just want to scaffold something in an already existing directory /a/very/long/path/with/a/lot/of/subdirectory?

This is a very annoying problem and it should be an option.

@ericmorand
Copy link

@SBoudrias I submitted a PR for this one. Would you mind looking at it? It's pretty small and safe and a test has been implemented.

SBoudrias pushed a commit that referenced this issue Dec 1, 2016
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

2 participants