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

[rush] Rush pre/post build hooks should have access the arguments used to call rush build. #1223

Open
ghost opened this issue Apr 10, 2019 · 1 comment
Labels
enhancement The issue is asking for a new feature or design change needs design The next step is for someone to propose the details of an approach for solving the problem

Comments

@ghost
Copy link

ghost commented Apr 10, 2019

We want to use the arguments of our rush build command to modify the behavior of our post build script. However, we have found that these arguments aren't being passed into the post build script's command. Can we change this behavior?

@octogonz octogonz added enhancement The issue is asking for a new feature or design change needs design The next step is for someone to propose the details of an approach for solving the problem labels Apr 10, 2019
@octogonz
Copy link
Collaborator

octogonz commented Apr 11, 2019

This is a good idea. Looking at the design of the event hooks, they are shell commands that could already include their own command line parameters.

So perhaps the right design would be to follow the model of Git hooks, and pass the additional information as environment variables.

For example, if you invoke:

rush build --production --verbose

Then perhaps the hook script would get invoked with these variables:

RUSH_HOOK_COMMAND="build"
RUSH_HOOK_COMMAND_PARAMETERS="--production --verbose"

This follows the "Custom Commands" naming conventions.

In the future maybe we would provide other variables.

@iclanton what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is asking for a new feature or design change needs design The next step is for someone to propose the details of an approach for solving the problem
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant