grunt-text-replace icon indicating copy to clipboard operation
grunt-text-replace copied to clipboard

Add support for an expand option?

Open micahblu opened this issue 10 years ago • 7 comments

It be very nice to maintain the directory structure from src wildcard matches.

For example let's say I have:

replace: {
  html: {
    src: ['src/**/*.html'],
    dest: 'dist/'
    // the rest
  }
}

In this case the dist gets a flattened version of the src files, losing directories and possibly overwriting files, for example a directory with index.html would overwrite the root index.html. It'd be nice to have an expand option that would build the directories as needed.

micahblu avatar Oct 30 '14 23:10 micahblu

I agree this would be nice. A work around would be to copy the tree to your new location and then run the replace on the files in place.

fantapop avatar Jan 07 '15 02:01 fantapop

I actually have a detached fork where I implemented the feature: https://github.com/micahblu/grunt-replace-text

micahblu avatar Jan 07 '15 03:01 micahblu

okay, no pull request?

fantapop avatar Jan 07 '15 05:01 fantapop

I did, but he didn't reply in time and I needed an updated git repo for dev deployments at work

micahblu avatar Jan 07 '15 05:01 micahblu

I'll do another pull request, I believe he did eventually reply.

micahblu avatar Jan 07 '15 07:01 micahblu

That would be appreciated. Thank you!

On Tue, Jan 6, 2015 at 11:08 PM, Micah Blu [email protected] wrote:

I'll do another pull request, I believe he did eventually reply.

— Reply to this email directly or view it on GitHub https://github.com/yoniholmes/grunt-text-replace/issues/25#issuecomment-68986370 .

fantapop avatar Jan 07 '15 07:01 fantapop

I've submitted a pull request that should do the trick

micahblu avatar Feb 21 '15 00:02 micahblu