Search code examples
continuous-integrationnant

Clear all subdirectories, but not remove them in NAnt


How to clear subdirectories without removing them in NAnt?

As the result of script execution, I need a directory with the same subdirectories, but empty:

<delete>
  <fileset basedir="\\${conf.server.frontend}\wwwroot">
    <include name="???" />
  </fileset>
</delete>

Solution

  • This is what you need:

    <delete>
        <fileset basedir="\\${conf.server.frontend}\wwwroot">
            <include name="**\*" />
        </fileset>
    </delete>