[英]Calling bash script from ant in (linux) and (cygwin on windows)
I have a bash
script called bashScript.sh
. 我有一个名为
bashScript.sh
的bash
脚本。
I need to start bashScript.sh
inside an ant
script on windows(cygwin) and unix/linux. 我需要在windows(cygwin)和unix / linux上的
ant
脚本中启动bashScript.sh
。
How do i do this? 我该怎么做呢?
I have tried this, and a few other solutions, using the environment variable but there is no env.OSTYPE
. 我尝试了这个,以及一些其他解决方案,使用环境变量,但没有
env.OSTYPE
。 And using... 并使用......
<exec executable="/bin/bash" failonerror="true">
<arg value="bashScript.sh"/>
</exec>
...does not work on windows(cygwin), because cygwin fails to find \\bin\\bash
. ...不适用于Windows(cygwin),因为cygwin无法找到
\\bin\\bash
。
Thanks, if you need more information let me know. 谢谢,如果您需要更多信息,请告诉我们。
You can create two exec
tasks with different osfamily
s. 您可以使用不同的
osfamily
创建两个exec
任务。
Like this: 像这样:
<exec dir="." executable="C:\Path\to\cygwin\bin\bash" osfamily="windows">
<arg value="bashScript.sh"/>
</exec>
<exec dir="." executable="/bin/bash" osfamily="unix">
<arg value="bashScript.sh"/>
</exec>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.