Code Monkey home page Code Monkey logo

Comments (8)

ctalkington avatar ctalkington commented on August 21, 2024

that is exactly the issue. we really only know about the files that exist so based on that a basePath is found. this is assist in preventing deep folder structures say you are copying a set of files that were generated by another task into a compiled/type/{files} setup, before basePath you would end up with compiled being the root of the copied structure. however basePath finds type to be the root because it has the files your minimatch told it about. it effectively just compressed the depth by 2 levels.

you can easily override and set basePath to stuff to get expected results. this seems to come up a bit but the task was never intended to work like cp. It is a copier using grunt conventions and usually you'd be dealing with compiled results so thats why it auto-attempts to find basePath.

from grunt-contrib-copy.

jryans avatar jryans commented on August 21, 2024

Okay, I guess I would recommend being even more explicit about this important distinction.

I did read the "Recent Confusion" section of this task's README, but being a new Grunt user, I did not realize that "designed to use grunt conventions" means "omits directories". Since you are saying this is as designed, perhaps an additional example demonstrating this behavior would be helpful. Is there any grunt documentation that would lead me to expect this convention? When I read the source of this task, the only conclusion I came to was that this was some kind of bug, because this choice seems very surprising to me.

from grunt-contrib-copy.

tkellen avatar tkellen commented on August 21, 2024

@ctalkington

Any chance you could distill your last post into a sentence or two that can go in the basePath section for the readme on this task?

from grunt-contrib-copy.

ctalkington avatar ctalkington commented on August 21, 2024

ill see what i can come up with, i think im going to revisit how basePath works a bit. one thing i plan to add is option to use false and have it leaves paths alone for those who aren't happy with its results, i also want to make a helper that does all the trimming of basePath from a string just so its centralized.

from grunt-contrib-copy.

ctalkington avatar ctalkington commented on August 21, 2024

please see #18. added notes and added ability to pass false to disable completely. think this issue can be closed.

from grunt-contrib-copy.

vitalets avatar vitalets commented on August 21, 2024

faced with the same issue. It's better to have option for such behavior that a bit unexpected.

from grunt-contrib-copy.

ctalkington avatar ctalkington commented on August 21, 2024

basePath is replaced with cwd in v0.4 devel. this should resolve a lot of the confusion.

from grunt-contrib-copy.

ctalkington avatar ctalkington commented on August 21, 2024

this can be closed as its resolved with new cwd feature in devel

from grunt-contrib-copy.

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.