I would like to add an automatically generated file based on pre-or post-only files that are Committed to commit How would I go about this?
I have tried to do this as a pre-cut hook, but no luck:
#! / Bin / sh files = `git diff --cached --name-status` re =" files of importance " If [[$ files = ~ $ re]] resonates "creating file" then "exec bundle exec" create_my_files exec git my_files exec add git command - -mind-c HEAD fi < P> It successfully connects them to the repository, but do not add them to commit. I have also tried with pre-commit inspection in post-cut hook using the previous two AGC lines, but no one is good .
It is possible for you to use a pre-committed hook. We do something similar for a heroku deployment (javascript to coffeescript compile). The reason your script is not working, because you used the exec command inappropriately.
From:
Replace current moving shell process image with a new command. On successful completion, exec never returns. The exec can not be used inside a pipeline.
Only your first exec command is going on, after which your script is basically finished.
Try something like this (as a pre-cut hook):
#! / Bin / sh files = `git diff --cached --name-status` re =" files of importance " If [[$ files = ~ $ re]] then "create files" bundle exec_my_files git my_files fi
Comments
Post a Comment