Git Product home page Git Product logo

Comments (7)

rmboggs avatar rmboggs commented on July 3, 2024

Just a bit of background as I believe you are referencing some of the work that I did to the move task that was backed out prior to 0.91 release. That work was to introduce a simplified way of moving entire directories with the move task. It was backed out because there was question/concern with the proposed syntax as well as how it functioned internally. I do have plans of taking another stab at it but it'll take a bit of time.
In the meantime, the move task today can move entire directories with the following example:

<move tofile="target/dir">
  <fileset basedir="source/dir"/>
</move>

It's a bit of a wrist cramper but it works.

Hope this adds clarity.

from nant.

fastcat avatar fastcat commented on July 3, 2024

I found that in the documentation, but it doesn't seem to actually work. It in fact seems to do nothing. For example:

  <target name="build">
    <mkdir dir="a"/>
    <mkdir dir="a/test"/>
    <touch file="a/test/stamp" />
    <move tofile="b" verbose="true" includeemptydirs="true">
      <fileset basedir="a" />
    </move>
  </target>

produces:

build:

   [delete] Deleting directory 'C:\src\nantest\a'.
    [mkdir] Creating directory 'C:\src\nantest\a'.
    [mkdir] Creating directory 'C:\src\nantest\a\test'.

The mkdir and touch calls do their thing, but when it gets to the move task, it seems to silently decide that there's nothing it needs to do. No messages, warnings, or errors.

If I change tofile to todir, and add an in the fileset, then it moves all the files over, but leaves all the directories behind.

I ended up resorting to calling out to cmd.exe via the exec task for my scenario, esp. since it's important for me that the directory rename be atomic, and not leave partial results behind if there is a file locking error.

from nant.

rmboggs avatar rmboggs commented on July 3, 2024

Ok, I'll take a look.

from nant.

rmboggs avatar rmboggs commented on July 3, 2024

Yeah, there is an issue here. This task is assigned to me. My work for this issue will be done here.

from nant.

rmboggs avatar rmboggs commented on July 3, 2024

I believe I have addressed this issue in the referenced pull request but it needs review. If you are interested, please take a look and see if this fixes it.

from nant.

rmboggs avatar rmboggs commented on July 3, 2024

Just merged Pull Request #39 that should address this issue. The next nightly build (should be built tomorrow) should have this fix included. In the meantime, I'll close this ticket.

from nant.

patricktoohey avatar patricktoohey commented on July 3, 2024

think your syntax is just wrong. should use todir not to file. try...

On Fri, May 23, 2014 at 11:33 AM, andrewducker [email protected]:

I'm trying to do this - and failing. If I use the following then I get an
exception:

System.NullReferenceException: Object reference not set to an instance of
an object.
at
NAnt.Core.Tasks.CopyTask.FileOperation.TargetDirectoryDoesNotExist(DirectoryInfo
source, DirectoryInfo target)
at NAnt.Core.Tasks.CopyTask.ExecuteTask()

Is this related to the above error? We're using Nant 0.92


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-44026211
.

from nant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.