curist / grunt-bower

grunt task to copy bower installed packages to other folder(s)
MIT License
93 stars 27 forks source link

dest is not taken into account with grunt-0.0.4 #6

Closed PEM-- closed 11 years ago

PEM-- commented 11 years ago

grunt: 0.0.4rc7 grunt-contrib: 0.4.3

Here's the story. I've overriden the dest folder. Unfortunately, no matter how I change the dest, only /public/scripts/vendor is used as the default.

Here's the Gruntfile in CS (for the sake of brievity):

module.exports = (grunt) ->
  grunt.initConfig
    bower:
      dev:
        dest: 'app/vendors'
      dist:
        dest: 'temp/vendors'
  grunt.loadNpmTasks 'grunt-bower'
  grunt.registerTask 'default', ['bower']

The problem occurs in tasks/bower.js. In registerMultiTask, this.file should take an array instead of a simple value. Here's the translated JS from CS (I've tried to keep compatibility with grunt-0.0.3 series):

27a28
> 
29,30c30
<       var _ref, _ref1, _ref2;
<       var dest = ((_ref = this.file) != null ? (_ref1 = _ref[0]) != null ? _ref1.dest : void 0 : void 0) || ((_ref2 = this.file) != null ? _ref2.dest : void 0) || path.join('public', 'scripts', 'vendor');

---
>     var dest = this.file.dest || path.join('public', 'scripts' ,'vendor');
32a33
> 

If you need further info, do not hesitate.

curist commented 11 years ago

Many thanks for reporting this, fixed in grunt-bower v0.4.4