kalamuna / metalsmith-jstransformer

Metalsmith JSTransformers Plugin
http://npm.im/metalsmith-jstransformer
MIT License
7 stars 9 forks source link

Remove odd file clone on rename #25

Closed ycherniavskyi closed 7 years ago

ycherniavskyi commented 7 years ago

The previous implementation technically correct, but it breaks plugins metalsmith flow.

For example in my case metalsmith-collections -> metalsmith-jstransformer -> metalsmith-better-excerpts -> metalsmith-jstransformer file objects in collections (created by metalsmith-collections plugin) after clone on rename is dirrefent from file objects in global files collection and as result updating/changing metadata in last one does affect first one, which complitly break the intention of metalsmith-collections plugin.

RobLoach commented 7 years ago

I forget why I did the clone and delete rather then just rename. I remember there was an issue with what you suggest here, but I don't remember exactly what it was.

Let's merge this, and test heavily. I'll make a release of this after we test this a few other places.

Thanks!

ycherniavskyi commented 7 years ago

Thanks. I run tests and they all pass :smile:.

ycherniavskyi commented 7 years ago

@RobLoach maybe it is time to create next version with last modification and publish it to npm? :blush: