Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext: '' should remove the extension #1087

Closed
silvenon opened this issue Mar 7, 2014 · 5 comments
Closed

ext: '' should remove the extension #1087

silvenon opened this issue Mar 7, 2014 · 5 comments

Comments

@silvenon
Copy link

silvenon commented Mar 7, 2014

I think that would make more sense than just ignoring the empty string and leaving the extension.

files: [{
  expand: true,
  cwd: 'app',
  src: '*.html',
  dest: 'dist',
  ext: ''
}]
@cowboy cowboy closed this as completed in 27b918d Mar 7, 2014
@silvenon
Copy link
Author

silvenon commented Mar 7, 2014

That was lightning fast, thank you.

@cowboy
Copy link
Member

cowboy commented Mar 7, 2014

Issue submitters: don't let the fact that I closed this issue in 18 minutes go to your heads, I just happened to be working on adding the extDot option in e08e4df and still had Grunt and node-globule open in my text editor. So there!

@youcandanch
Copy link

This does sort of introduce a weird breaking change for folks who have followed documentation that states when using the rename function, you should have ext: ''. I came across this issue this weekend and it was a pretty easy fix (and I totally agree with this pull req), but it may cause folks using rename to have issues.

@youcandanch
Copy link

Just to point out what I'm talking about:

files: [{
  expand: true,
  cwd: 'app',
  src: '**',
  dest: 'dist',
  ext: ''
  rename: function (dest, src) { console.log(src) }
}]

In this case, if I have a file in /app that has the filename of my-javascript-file.min.1.2.3.js, src in the rename function will come through as my-javascript-file, where it should be my-javascript-file.min.1.2.3. I'm not sure if this is an existing issue elsewhere.

@youcandanch
Copy link

Sorry for overcommenting, just digging through and it looks like this is actually expected functionality, as shown here and in #979. So, my question is, without digging into the source of each contributed plugin, is there a way to change extDot? Sorry if I'm just missing something totally obvious.

Edit: Yes, totally missing something obvious! Maybe I should actually read the issue when I link to it:

files: [{
  expand: true,
  cwd: 'app',
  src: '**',
  dest: 'dist',
  ext: ''
  extDot: 'last',
  rename: function (dest, src) { console.log(src) }
}]

Sorry @cowboy for the stream of consciousness comments. Appreciate the fix! I added it to the doc repo in gruntjs/grunt-docs#50, just so anyone else who comes across it can spend less time rambling in PR comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants