ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Why doesn't Exec always cd on Windows?
Date Fri, 09 Jun 2000 21:04:53 GMT

Stefan Bodewig wrote:

> The problem is here:
>         if (myos.toLowerCase().indexOf("windows") >= 0) {
> -->         if (!dir.equals(project.resolveFile(".")))
>                 command = "cmd /c cd " + dir + " && " + command;
> When executing an <ant> task, this sub-Ant gets it's basedir set
> to the place where the build.xml resides and thus
> project.resolveFile(".") returns the name of the subdirectory
> allthough this is not the dir Ant has been called from.
> Why is this check there in the first place? Can we savely remove
> the check and everything's fine? Note I'm not too familiar with
> Windows if this sounds like a dumb question.

For starters, cmd doesn't work on 95/98 (so that's a bug).

Worse yet, if you do multiple commands Windows NT/2000 will open up a new
window and you can't capture the output.

I spent quite some time on this, and have yet to find a solution that

- Sam Ruby

View raw message