Hi Martin,

You can always use a combination of the available task and the if task.

Gert

----- Original Message ----- 
From: "Martin Aliger" <[EMAIL PROTECTED]>
To: "! nant" <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 2:51 PM
Subject: [nant-dev] branching in nant


> Hi all,
>
> I want to check whether directory exists and branch by the result. Is it
> possible in current NAnt?
>
> I add some <if> attributes for now but maybe this could be solved in
general
> way. Maybe to set some ${result} property in tasks (as <mkdir> task in
this
> case). It could be possible check that property against some error codes
or
> so. When I first come to NAnt I was really shocked you couldn't check
result
> code of previous task. Except of failonerror="true" of course. This is
> enough in most cases but sometimes you want to check for error and make
some
> other action.
>
> How do you feel about it?
>
> Martin
>
>
> here is snip from my build file to see what I want to do:
>
>      <copy todir="${build.dir}">
>       <fileset basedir="${local.dir}">
>        <includes name="**"/>
>       </fileset>
>      </copy>
>
>      <foreach item="Folder" in="${source.dir}" property="foldername">
>       <regex pattern="^(?'path'.*(\\|/)|(/|\\))(?'folder'.*)$"
> input="${foldername}"/>
>       <ifnot pathexists="${build.dir}\${folder}">
>        <copy todir="${build.dir}" overwrite="false">
>         <fileset basedir="${source.dir}">
>          <includes name="${folder}\**"/>
>         </fileset>
>        </copy>
>       </ifnot>
>             </foreach>
>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to