Installing components
lukejagodzinski opened this issue · comments
I've installed few components using bower install
from command line being in public
directory. Now when I start meteor project polymer package is trying to download polymer one more time and it shouldn't and it creates public folder inside public folder etc.
In your polymer-elements package you are using this piece of code to download elements:
var dir = path.join(path.relative(process.cwd(), process.env.PWD), 'public/bower_components');
Bower.install(['Polymer/core-elements#0.4.0', 'Polymer/paper-elements'], {save: true}, {directory: dir});
I don't think that users of your package should use this kind of solution to import components. Could you describe the process of importing components?
Sorry my mistake. I was starting Meteor from public directory. However it should take it into account that someone can be in another directory and then relative directory will change.
Does anyone know how to get the application's root path. process.env.PWD
gives the working directory, but as noted above it is possible to launch a meteor application from within subdirectories.
Any ideas?
You can use __meteor_bootstrap__.serverDir
what gives following result /Users/jagi/workspace/app/web/.meteor/local/build/programs/server
and then you can strip it down to .meteor
location. Meteor finds root directory by going up in directories tree starting from process.env.PWD
.
Totally new method with new package.