hparra / gulp-rename

Rename files easily
MIT License
692 stars 73 forks source link

Return path in rename by function example #57

Closed florianeckerstorfer closed 9 years ago

florianeckerstorfer commented 9 years ago

At least the only way I got renaming by function to work is by adding return path; to the function.

shinnn commented 9 years ago

Sorry for the late response but I'd rather revert this. Whether the path object is returned or not doesn't affect renaming result. This documentaton change would just confuses users.

At least the only way I got renaming by function to work is by adding return path; to the function.

@florianeckerstorfer Can you provide an example that can reproduce the problem?

yocontra commented 9 years ago

@shinnn I only merged this because I also had this problem before, so I guess we should open a ticket for fixing this then revert the doc change.

yocontra commented 9 years ago

I think the return is a better API decision though IMO - otherwise people will try to do async shit in there and it won't work

shinnn commented 9 years ago

I think the return is a better API decision though IMO

Previously gulp-rename checked the return value first, and used the original path object as a fallback, but it was removed in https://github.com/hparra/gulp-rename/pull/24.

florianeckerstorfer commented 9 years ago

After checking again I could not reproduce the error, maybe I was on a earlier version, I don't know. I kinda expected the return, because when I was reading the docs I was wondering "no return?" and thats why I created the PR prematurely. Sorry for that.

shinnn commented 7 years ago

Reverted in https://github.com/hparra/gulp-rename/pull/72.