找不到git post-update挂钩中的Bash命令

use*_*569 5 git bash terminal amazon-ec2 githooks

我在git post-update钩子中有以下代码cd进入我的工作目录并从这个git hook所在的裸git repo中拉出来:

cd $HOME/www/firefly

unset GIT_DIR

git pull hub master

combine

npm rebuild

exec git update-server-info
Run Code Online (Sandbox Code Playgroud)

问题是当它运行时combine,我得到:

hooks/post-update: line 14: combine: command not found
Run Code Online (Sandbox Code Playgroud)

奇怪的是,如果我手动cd进入我的工作目录并运行combine它成功执行该文件.我究竟做错了什么?

wad*_*rld 7

Combine不是shell命令.您可能需要完整路径或者./combine它位于同一目录中.

出现错误的原因是运行脚本时路径不同.