ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <epr...@ptc.com>
Subject ant on Cygwin -- spaces in dirnames
Date Fri, 28 Feb 2003 17:47:47 GMT
Hi,

I have installed Ant onto my Win2k box (which runs Cygwin) by 
downloading the ZIP binary distribution (1.5) and putting it in 
/cygdrive/c/Program Files/ant/ .  I have added the ant distribution's 
bin directory to my path, and can execute the ant wrapper script by calling

localhost$ ant

from the Cygwin command line.  The problem is that I get an error 
whenever I do run this command:

cd: can't cd to /cygdrive/c/Program

I have looked over the ant wrapper script and can see the problem, on 
line 52, it says:

   # need this for relative symlinks
   cd `dirname "$PRG"`

The problem is that the result of `dirname "$PRG"` is a file path with a 
space in it.  I would like to solve this problem.  Can anyone counsel me 
in the best solution:

1. Manually fix the shell script by adding additional variables to 
escape the space in the pathname at every point where `dirname "$PRG"` 
is used.
2. Move the Ant distribution to a directory without a space.
3. Some other solution that I am not aware of?

1. is not really ideal, since it seems like unnecessary work (surely I'm 
not the only person using ant on Cygwin) and would need to be done again 
if I upgrade to a new Ant, plus it de-virginizes my ant shell script. 
2. is not really ideal because it seems there are precious few 
directories without spaces in their names on this machine.  (I am not 
very knowledgeable of Windows.)

I'm curious how other Cygwin users install Ant so that it works for 
them.  Am I not doing something right?  I am really inexperienced with 
both Cygwin and Windows issues so please forgive me if the solution is 
obvious.


Erik


Mime
View raw message