Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge .bowerrc with global bower #1689

Closed
sebakerckhof opened this issue Feb 6, 2015 · 7 comments
Closed

Merge .bowerrc with global bower #1689

sebakerckhof opened this issue Feb 6, 2015 · 7 comments
Labels

Comments

@sebakerckhof
Copy link

Hello,

I'm working with a team on a couple of repositories.
Some of these repositories have their bower components installed in a directory named, others in the default bower_components. This is specified in the bowerrc file in each repository

The problem is that some of our team are working behind a proxy and others are not working behind a proxy. This also needs to be defined in the .bowerrc file. Therefore the .bowerrc file is different between team members.

Now, I could not add the bowerrc file to git, but then every member needs to know the correct setting for the "directory" setting (and some others, like "scripts", which is also custom for each repository).

Ideally I would only specify "directory" and "scripts" in the repositories .bowerrc file and bower would merge this with my global .bowerrc file, where I specify my proxy settings.

@sheerun
Copy link
Contributor

sheerun commented Feb 6, 2015

You can place .bowerrc in project's directory. Does it solve this problem?

@sebakerckhof
Copy link
Author

Well, I have a directory structure like so:

├──  repository/
│   └──  .bowerrc
└──  .bowerrc

The bowerrc file in the repository directory contains:

{
  "directory":"app/lib"
}

And the .bowerrc file in the root directory contains:

{
  "proxy":"http://192.168.12.102:3128",
  "https-proxy":"http://192.168.12.102:3128"
}

According to the bower docs, these two should be merged by bower, therefore the total configuration used by bower should be:

{
  "directory":"app/lib",
  "proxy":"http://192.168.12.102:3128",
  "https-proxy":"http://192.168.12.102:3128"
}

Yet, bower doesn't seem to do this. It doesn't use the proxy settings defined in the .bowerrc in the root directory. Only when I update the .bowerrc in the repository directory manually to include the proxy settings does it work...

I use windows 7 pro x64, bower 1.3.12 and nodejs 0.10.35

@sheerun
Copy link
Contributor

sheerun commented Mar 11, 2015

I can confirm. Only first .bowerrc is used. A fixing PR with tests for https://github.com/bower/config/blob/master/lib/util/rc.js#L31 would be appreciated.

@sheerun sheerun added the bug label Mar 11, 2015
@sheerun sheerun added this to the 1.4 milestone Mar 11, 2015
@samccone
Copy link
Member

Leaning on the giants here, .gitignore works in a similar fashion as to what was proposed here. so 👍

@kodypeterson
Copy link

@sheerun I can take a look at this!

@sheerun
Copy link
Contributor

sheerun commented Mar 25, 2015

OK :)

@kodypeterson
Copy link

@sheerun the fix PR is here https://github.com/bower/config/pull/24

Also, this repo never had tests 😮 Now it does 😄

Still needs more tests, but this is a good start!

@sheerun sheerun closed this as completed Mar 30, 2015
@sheerun sheerun mentioned this issue Mar 30, 2015
16 tasks
sheerun added a commit that referenced this issue Mar 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants