0

We have both the server and client parts of the project in our project directory.

Structure looks like

project/
|_java_server/
|_react_ui/
|_README.md
|_...

On the project we enabled the git pre-push script with the husky library. The pre-push script runs only package.json scripts in the react_ui folder with linting, testing, etc.

The problem is that the script runs on every push to the server even if only the java_server files were changed.

So question. Can I configure pre-push hook in the way it runs only if files in react_ui/ were changed?

torokhkun
  • 49
  • 1
  • 6

1 Answers1

0

No, but you can write the hook script in such a way that it examines the changes and only does anything if the changes require it.

If you're using a 3rd-party script for the hook, instead write your own script that examines the changes to decide whether to call the 3rd-party script.

Mark Adelsberger
  • 42,148
  • 4
  • 35
  • 52