Closed Kuirak closed 10 years ago
Just tested with the config you provided. Except package specified destination doesn't work, the rest works as expected.
Using your config and run grunt bower
, I got the following structure:
.tmp
└── public
├── css
│ └── bootstrap
│ └── bootstrap.css
└── fonts
├── bootstrap.js
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
└── glyphicons-halflings-regular.woff
strange because it is copying the complete bowercomponents/dist tree aditionally e.g: .tmp\public\js\components\bowercomponents\bootstrap\dist\js\bootstrap.js .tmp\public\js\components\bootstrap.js
my complete task looks like:
grunt.config.set('bower', {
dev: {
dest: '.tmp/public',
js_dest: '.tmp/public/js/components',
css_dest: '.tmp/public/styles/components',
options: {
packageSpecific: {
bootstrap: {
files: [
"./dist/js/bootstrap.js",
"./dist/css/bootstrap.css",
"./dist/fonts/glyphicons-halflings-regular.eot",
"./dist/fonts/glyphicons-halflings-regular.svg",
"./dist/fonts/glyphicons-halflings-regular.ttf",
"./dist/fonts/glyphicons-halflings-regular.woff"
],
dest: '.tmp/public/fonts',
css_dest: '.tmp/public/css/bootstrap'
}
}
}
}
});
grunt.loadNpmTasks('grunt-bower');
Duh.. still can't reproduce it. Will look into this again later.
Ok , no problem, i put bootstrap in manually for now. Tell me if you need anything else.
Please use this gist https://gist.github.com/curist/10078523 and see if you still have this problem.
I had this problem and figured it out.
grunt-bower/tasks/lib/helpers.js line 50 and its 'else' part doesn't path.join
with components_path
I patched as following:
if(typeof main_path === 'string') {
main_path = path.join(components_path, main_path);
...
} else {
// array, falling through
main_path = main_path.map(function(file) {
return path.join(components_path, file);
});
return main_path;
}
Also, make sure .bowerrc
's directory
ends with /
. Otherwise bower.commands.list
will generate quite weird relative paths (with duplicate of last part of path).
Eh, that's weird.
The main_path
is passed from bower.command.list
, and it's the full path to the files.
What's the result of bower list --paths
?
And about the .bowerrc
's directory
issue, I tested both with or without /
, all runs fine for me.
Are you guys running a windows machine?
I was wrong about a trailing slash issue. I found 'bower list --path' issue https://github.com/bower/bower/issues/928 For me bower.commands.list 's result list contains inappropriate paths then causes copy failure.
That seems to nailed it, will think about how to deal with it. Thanks for reporting this!
I work around that by passing options with 'relative : false'.
On Wed, Apr 9, 2014 at 12:05 PM, Curtis Chang notifications@github.comwrote:
That seems to nailed it, will think about how to deal with it. Thanks for reporting this!
— Reply to this email directly or view it on GitHubhttps://github.com/curist/grunt-bower/issues/20#issuecomment-39924507 .
Jooyung Han
Yea, that works. Thanks!
hey i am using grunt-bower to copy my bower packages in a new folder, when i tried using bootstrap i stumbled on to a problem: it is copying the files but not only the source files but the complete path
I get _public/js/bowercomponents/dist/js/bootstrap.js instead of public/js/bootstrap.js
other packages work like intended
When adding these to the config:
Everything get compied where it should but it copies a extra copy like before