I have the following code in a git post-update hook that cd‘s into my working directory and pulls from the bare git repo where this git hook lives:
cd $HOME/www/firefly
unset GIT_DIR
git pull hub master
combine
npm rebuild
exec git update-server-info
The problem is that when it runs combine, I get:
hooks/post-update: line 14: combine: command not found
The weird thing is that if I manually cd into my working directory and run combine it successfully executes the file. What am I doing wrong?
Combine isn’t a shell command. You likely need the full path or
./combineif it’s in the same directory.The reason for the error is your path is different when running the script.