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

fix(core): pass workingDirectory to executed schematic, if found in schema #19371

Merged
merged 12 commits into from
Nov 14, 2023

Conversation

pkirchniawy
Copy link
Contributor

This PR forwards the current directory to the schematic as workingDirectory argument, if present in schema.

The Angular Schematics, e.g. @schematics/angular:service, use the root dir as default, if no path is provided to the schematics.

Current Behavior

Executing npx nx g s foo in a directory other than root e.g. /services, will cause the files to be generated under /src which is false.

Expected Behavior

Executing npx nx g s foo in a directory other than root e.g. /services, will cause the files to be generated under /services/.

Related Issue(s)

Fixes #19308

…chema

The Angular Schematics, e.g. @schematics/angular:service, use the root dir as default, if no path is
provided to the schematics. This fix adds the dir the command is executed to the executed schematic.

closed nrwl#19308
@pkirchniawy pkirchniawy requested a review from a team as a code owner September 28, 2023 15:35
@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Nov 14, 2023 9:25am

@AgentEnder AgentEnder merged commit 4a5659e into nrwl:master Nov 14, 2023
6 checks passed
FrozenPandaz pushed a commit that referenced this pull request Nov 17, 2023
…chema (#19371)

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
(cherry picked from commit 4a5659e)
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2023
@pkirchniawy pkirchniawy deleted the fix/workingDirectory-schematic branch November 21, 2023 07:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nx generate service doesn't account for the current directory
3 participants