我有一个带有名称的bat文件jenkins.bat
开始在詹金斯服务器上构建进程。
现在我想在 git 中将这个 bat 文件作为 post-commit-hook 执行。
因此创建了以下文件post-commit
在文件夹中/.git/hooks
:
#!/bin/bash
/.git/hooks/jenkins.bat
但是每次将代码更改提交到 git 时,eclipse 都会抛出异常!我错过了什么?
您需要使用绝对路径或相对路径
-
绝对:/c/...
-
或者,正如所评论的,相对的,意思是不以/
./jenkins.bat
假设您的提交后挂钩是可执行的,并且在<repo>/.git/hooks
文件夹,您的jenkins.bat
似乎。
As Paul https://stackoverflow.com/users/63209/paul提及在评论中 https://stackoverflow.com/questions/46697870/git-post-commit-hook-how-to-start-a-bat-file-in-windows/46701655?noredirect=1#comment112471937_46701655
Doing ./jenkins.bat
does not当批处理文件位于 hooks 目录中时工作:您将得到一个“no such file
" error.
这是因为钩子的工作目录 https://stackoverflow.com/a/7402697/6309.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)