Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update usemin.js #80

Closed
wants to merge 1 commit into from

2 participants

Ian Crowther Nicolas Gallagher
Ian Crowther

As grunt.file.expand always returns an array, the "falsy" check will always be true, even if the array is empty

Ian Crowther Update usemin.js
As grunt.file.expand always returns an array, the "falsy" check will always be true, even if the array is empty
4f1c33f
Nicolas Gallagher

Closing as this project is not maintained anymore. Check out yeoman.io instead

Nicolas Gallagher necolas closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. Update usemin.js

    Ian Crowther authored
    As grunt.file.expand always returns an array, the "falsy" check will always be true, even if the array is empty
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 tasks/usemin.js
4 tasks/usemin.js
View
@@ -1,4 +1,3 @@
-
var fs = require('fs'),
path = require('path');
@@ -153,7 +152,8 @@ module.exports = function(grunt) {
var filepath = grunt.file.expand(path.join('**/*') + basename)[0];
// not a file in intermediate, skip it
- if(!filepath) return match;
+ if(!filepath || filepath.length === 0) return match;
+
var filename = path.basename(filepath);
// handle the relative prefix (with always unix like path even on win32)
filename = [dirname, filename].join('/');
Something went wrong with that request. Please try again.