ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fetzer <elstonk...@yahoo.com>
Subject Re: Calling CYGWIN from ANT via EXEC
Date Wed, 14 Apr 2010 23:00:59 GMT
Yeah, I was using the scp task before.  It started crashing every single week for no apparent
reason.  If you run it a second time with the exact same code it works.  So here I am...



On Apr 14, 2010, at 4:32 PM, Antoine Levy Lambert <antoine@gmx.de> wrote:

Eric Fetzer wrote:
It's actually much easier to use CYGWIN from Ant than stated in the documentation with the
<exec> task.  Here is an example of using Ant to run a shell script via CYGWIN (be sure
the shell script is formatted for unix):
                  <exec executable="c:\cygwin\bin\bash.exe">
                    <arg value="--login"/>
                    <arg value="-c"/>
                    <arg value="/cygdrive/c/BuildDeployScripts/scp_files.sh ${scp.keyfile}
${fileToSCP} ${scp.user} ${scp.remote.host} ${scp.target.dir}"/>
                  </exec>
Note that all arguments to the script in this case must be on the same <arg> as the
script file or they won't show up as args to the script, but rather, args to bash.  I haven't
figured out how to send an argument with spaces in it, but I'm sure you Ant guru's could tell
me.  Any help there?  I tried 'myScript.sh "argument with spaces" arg2', but that didn't work.
 CYGWIN wants spaces escaped.

Thanks,
Eric



       
I would have 2 suggestions for you :

- make a wrapper bash script to work around the issue of argument with spaces, maybe write
the arguments to a file that cygwin bash can source like

arg1=something
arg2=bla
...


- or get cygwin and scripting out of the equation and reimplement completely in ant what scp_files.sh
does, if it is not too complicated. The name suggests that you could use the scp task of ant.

Regards,

Antoine

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message