设置Mercurial挂钩的环境变量
时间:2020-03-06 14:19:09 来源:igfitidea点击:
我正在尝试调用一个shell脚本,该脚本通过Mercurial钩子在我们的服务器上设置了一堆环境变量。当有新的变更组进入时,shell脚本会正常运行,但是环境变量不会继续调用shell脚本。
我在存储库中的hgrc文件如下所示:
[hooks] changegroup = shell_script changegroup.env = env I can see the output of the shell script, and then the output of the env command, but the env command doesn't include the new environment variables set by the shell script. I have verified that the shell script works fine when run by itself but when run in the context of the mercurial hook it does not properly set the environment. Thank you guys for any help you can provide. Solution Answer Shell scripts can't modify their enviroment. http://tldp.org/LDP/abs/html/gotchas.html
这就像在想我可以在一个php脚本中设置一个变量,然后简单地通过一个接一个地运行另一个对象来神奇地获取它。
代码数量不匹配