为什么我的 post-receive 挂钩无法运行 virtualenv source 命令?
我有一个以用户“git”身份运行的接收后挂钩。我有一个可由 git 读取的 virtualenv /python/ve//bin/activate 。运行:
source /python/ve/<name>/bin/activate
对于 git 组中的用户来说工作正常。
当它在推送后作为接收后挂钩运行时,我收到错误“源:未找到”。
我不知道还能去哪里看 - 任何提示都非常感谢。
I have a post-receive hook that is running as user 'git'. I have a virtualenv /python/ve//bin/activate that is readable by git. Running:
source /python/ve/<name>/bin/activate
works fine for a user in the git group.
When it runs as a post-receive hook after a push, I get the error "source: not found".
I'm not sure where else to look - any hints much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一种猜测,因为您还没有引用完整的
post-receive
挂钩,但我怀疑您没有 shebang 行 指向顶部的/bin/bash
。您的post-receive
钩子应该开始:我怀疑这一点,因为如果我运行严格的 Bourne shell,如
dash
,当尝试使用获取任何内容时,我会得到相同的错误>来源
。This is something of a guess, since you haven't quoted your complete
post-receive
hook, but I suspect that you don't have a shebang line pointing to/bin/bash
at the top. Yourpost-receive
hook should begin:I suspect this because if I run a strict Bourne shell, like
dash
, I get the same error when trying to source anything withsource
.