Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash command within a git post-update hook is not found

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?

like image 683
user730569 Avatar asked Jun 05 '12 22:06

user730569


1 Answers

Combine isn't a shell command. You likely need the full path or ./combine if it's in the same directory.

The reason for the error is your path is different when running the script.

like image 123
wadesworld Avatar answered Sep 22 '22 13:09

wadesworld