alanshaw / grunt-include-replace

Grunt task to include files and replace variables. Allows for parameterised includes.
MIT License
200 stars 45 forks source link

rename like grunt-contrib-copy? #27

Closed stevenvachon closed 10 years ago

stevenvachon commented 10 years ago

These produce /bin/src/index.production.html:

files:[ { src:"../src/index.production.html", dest:"../bin/index.html" } ]
src: "../src/index.production.html",
dest: "../bin/index.html",

This produces /bin/src/index.html/index.production.html:

files:[ { cwd:"../src/", src:"index.production.html", dest:"../bin/index.html", expand:true, flatten:true } ]

These produce nothing:

files:{ "../src/index.production.html" : "../bin/index.html" }
files:{ "../src/index.production.html" : ["../bin/index.html"] }
alanshaw commented 10 years ago

The last two are working as expected - you have the src/dest the wrong way around.

Using expand/flatten won't work. It doesn't work with grunt-contrib-copy either - you'd need to use the rename option.

I'm about to commit some code that'll allow you to do what you want in the first two examples.

alanshaw commented 10 years ago

Worth mentioning that you could probably use the rename option to achieve what you want without any code changes.

alanshaw commented 10 years ago

Released as grunt-include-replace@1.2.0

stevenvachon commented 10 years ago

Awesome, thanks!!