delete dir in Nant - error

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

This is probably the wrong group to post this in, but I'm not sure
where it should go. If you have suggestions as to another group to
post it let me know.

In our Nant build file for our application. I want to first delete 2
folders if they exist. These folders then later get created. If the
folders exist, I do not get errors, but if they do not, the build
fails.

<delete dir="${build.root}" />
From a Nant website it said that you wouldn't get an error if the
directory didn't exists, but that does seem to be the case for us.

Is there syntax to say: If exist...delete? I'm new to Nant and just
trying to maintain something someone else wrote and has now left the
company.

Thanks....
 
Sam said:
This is probably the wrong group to post this in, but I'm not sure
where it should go. If you have suggestions as to another group to
post it let me know.

In our Nant build file for our application. I want to first delete 2
folders if they exist. These folders then later get created. If the
folders exist, I do not get errors, but if they do not, the build
fails.

<delete dir="${build.root}" />

directory didn't exists, but that does seem to be the case for us.

Is there syntax to say: If exist...delete? I'm new to Nant and just
trying to maintain something someone else wrote and has now left the
company.

Thanks....

<delete if="${directory::exists(build.root)}" dir="${build.root}" />

and for files...

<delete if="${file::exists(filename)}" file="${filename}"/>

Tigger
 
Back
Top