hparra / gulp-rename

Rename files easily
MIT License
692 stars 73 forks source link

Appends filename but doesn't change extension #17

Closed lmartins closed 10 years ago

lmartins commented 10 years ago

Im trying to run this task on a folder of html email templates, which originally are php files, to convert them to preview files in html.

The -preview suffix is added correctly but the new file created still keeps the .php extension. Am I missing something here?

gulp.task('toHTML', function() {
  gulp.src("./html/**/*.php")
    .pipe(rename({
      suffix: "-preview",
      extname: ".html"
    }))
    .pipe(gulp.dest("./html/"));
});
hparra commented 10 years ago

That should work. Are you using latest version?

lmartins commented 10 years ago

Thanks @hparra, I was using the latest version available when I first opened the issue. Today, after upgrading, it does work as expected. Cheers.