curist / grunt-bower

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

Sources with multiple files 'fail' to copy #31

Closed simonh1000 closed 10 years ago

simonh1000 commented 10 years ago

I'm finding that sources with multiple files are failing to copy, while single file sources are fine. This is the output from grunt bower:

Fail to copy lib file for angular-strap!
/home/simon/code/Dropbox/HTML/afmobile/src/bower_components/angular/angular.js copied.
Fail to copy lib file for bootstrap!

I tweaked your code to get the caught error message: TypeError: Cannot read property 'keepExpandedHierarchy' of undefined

This is the output from bower list --path

{
  "angular-animate": "src/bower_components/angular-animate/angular-animate.js",
  "angular-route": "src/bower_components/angular-route/angular-route.js",
  "angular-sanitize": "src/bower_components/angular-sanitize/angular-sanitize.js",
  "angular-strap": [
    "src/bower_components/angular-strap/dist/angular-strap.min.js",
    "src/bower_components/angular-strap/dist/angular-strap.tpl.min.js"
  ],
  "angular": "src/bower_components/angular/angular.js",
  "bootstrap": [
    "src/bower_components/bootstrap/dist/css/bootstrap.css",
    "src/bower_components/bootstrap/dist/js/bootstrap.js",
    "src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot",
    "src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg",
    "src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf",
    "src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff"
  ],
  "jquery": "src/bower_components/jquery/dist/jquery.js",
  "underscore": "src/bower_components/underscore/underscore.js"
}

Here is my config

bower: {
            src: {
                dest: 'dist/bower_components',
                options: {
                    expand: false,
                    relative: true
                }
            }
        }

var flatten = package_opt.keepExpandedHierarchy === false || options.keepExpandedHierarchy === false; fixes it but I don't know enough about Grunt to know what else this might break