我在Windows和Linux操作系统上运行我的gradle脚本。当我在Windows操作系统上运行它时运行正常。我正在尝试执行hg命令来创建标记并将其推送到repository.Script工作正常。问题是标签名称。我使用下面的命令应用标签,该命令在Windows OS上正常运行.Gradle脚本正在运行此命令。
commandLine "hg tag -r $hash \"Build $cbversion\"".split()但是同样的命令在Linux OS上运行时会抛出一个错误,而不会将该标记与Build 1.2.3.4名称一起使用。我尝试了下面的命令,但没有运气
commandLine "hg tag -r $hash Build $cbversion".split()那么它会创建名称仅为Build的标签
有人能告诉我如何克服这个问题?
I am running my gradle script on both windows and Linux OS.This is running fine while I run it on Windows OS.I am trying to execute the hg command to create the tag and push it to repository.Script is working fine.The issue is tag name.I apply the tag with below command which is running fine on windows OS.Gradle script is running this command.
commandLine "hg tag -r $hash \"Build $cbversion\"".split()But the same command is throwing an error while running on Linux OS and not applying the tag with Build 1.2.3.4 name.I tried below command but no luck
commandLine "hg tag -r $hash Build $cbversion".split()then it creates the tag with name Build only
Could someone tell me how could I overcome from this problem?
最满意答案
这是exec进程而不是shell。 你不能在这里引用它来使它工作。 commandLine要么采用数组,要么将iteratable作为参数。 例如:
commandLine 'hg', 'tag', '-r', hash, "Build $cbversion"This is executing a process and not the shell. You can not quote here to make it work. commandLine either takes an array or iteratable as arguments. E.g.:
commandLine 'hg', 'tag', '-r', hash, "Build $cbversion"更多推荐
发布评论