Replies: 1 comment
-
Hey!
Yes, there's a workaround. You should explicitly stage the desired files (or all files). For example: pre-commit:
parallel: true
commands:
internationalization:
glob: 'public/locales/en-US/grafana.json'
run: yarn i18n:pseudo && git add {files}
stage_fixed: true Lefthook automatically stages fixed files only if they were changed before running lefthook. That behavior was added for convenience, and for cases when you need to change and stage some files like SQL dumps or locales, please use explicit |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a hook which modifies a seperate file from the originally comitted file, somewhat similar to codegen:
When
public/locales/en-US/grafana.json
is changed, we want to runyarn i18n:pseudo
which will modifypublic/locales/en-US/grafana.json
, and we want the changes to both files staged into the commit. Is this possible, through some kind of workaround, with lefthook?I initially tried to specify a list of files (just the en-US and the pseudo-LOCALE files) with the
files
config option, but then i noticed it's supposed to be a (git) command, so I tried the following:However that didn't work either.
Is there some kind of workaround to achieve what we want?
Beta Was this translation helpful? Give feedback.
All reactions