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

feat(core): "cwd" option for commands runner #2501

Merged
merged 6 commits into from
Feb 20, 2020

Conversation

rarmatei
Copy link
Collaborator

@rarmatei rarmatei commented Feb 18, 2020

Adds a cwd option to the @nrwl/workspace:run-commands builder:

"print-working-directory": {
          "builder": "@nrwl/workspace:run-commands",
          "options": {
            "commands": [
              {
                "command": "pwd"
              }
            ],
            "cwd": "apps/frontend/src"
          }
        }

(conceptually the same as the cwd option when creating a child process in Node)

@rarmatei rarmatei requested a review from jaysoo February 18, 2020 13:31
}
},
"required": ["commands"]
"required": ["commands"],
"additionalProperties": false
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaysoo - was there any reason we were not restricting additionalProperties before? Let me know if you can think of any issues with me adding this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will want this to be true so we can in theory pass extra params and forward them to the underlying command. We don't do it now, but we should

Copy link
Collaborator Author

@rarmatei rarmatei Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - yes, I initially thought we can use the args option for that - but I can see how it's a different use-case..args is more powerful / allows interpolation throughout the command and needs to be set-up beforehand in workspace.json

while allowing extra options would be simpler if one would want to just forward them to the underlying command like you say e.g. nx generate-docs frontend --option1="foo" --option2="bar"

I'll remove it 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that as a follow-up feature/PR where we do arguments forwarding.

@rarmatei rarmatei merged commit c04f8af into nrwl:master Feb 20, 2020
@github-actions
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 Mar 22, 2023
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.

None yet

3 participants