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

contextRoot should support npm script wrapper #603

Open
stevenvachon opened this issue Nov 1, 2018 · 4 comments
Open

contextRoot should support npm script wrapper #603

stevenvachon opened this issue Nov 1, 2018 · 4 comments

Comments

@stevenvachon
Copy link

Type of issue

Feature request or bug, not sure.

My environment

  • OS version/details: macOS 10.14
  • Node version: 10.11.0
  • npm version: 6.4.1
  • Version of yo : 2.0.5

Expected behavior

this.contextRoot contains the path to where the yo CLI was executed from. When yo is wrapped in an npm script (such as npm run generate), this.contextRoot should be the value of process.env.CWD_INIT.

Current behavior

When yo is wrapped in an npm script, this.contextRoot contains the path to the project root.

@SBoudrias
Copy link
Member

Looks like something we could fix. But I'm not 100% sure what would be the side effects.

Do you want to send a PR? This would help move the conversation forward.

@stevenvachon
Copy link
Author

I patched it in my team's generator. I may not have time to patch the yeoman source code.

@jaridmargolin
Copy link

I am facing the same "issue". I've hacked around it by altering my npm run script to change directories prior to calling yo, but it would be great if yo was just smart enough to do this on its own.

@levino
Copy link

levino commented Sep 22, 2020

This is still an issue for me. Trying to use yeoman in a monorepo and everything is always copied to the root, never the current folder. How did you solve this @stevenvachon ?

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

4 participants