Added support for JAMRC environmental variable #82

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

mmikulicic commented Oct 11, 2012

Added support for JAMRC environmental variable, that overrides the location of the .jamrc file.

Scenario:

I have two apps with a number of deps specified in their package.json.
Each of these two apps depends on a specific repository, so I would like they don't use a shared ~/.jamrc, however I don't want to create a specific user for each of these two apps.

jam install and jam upgrade have support for specifying the repository on the command line, but only one repository.

I would like to be able to run:

JAMRC=.jamrc jam upgrade

in each app and make sure they use the correct repository list.

Review on Reviewable

Contributor

clexit commented Oct 12, 2012

Shouldn't it be in projects package.json?

Something like

"jam": {
    "repositories": [
         //list
     ]
}
Contributor

mmikulicic commented Oct 12, 2012

Well, actually putting in package.json is a good idea.

Should the confs be merged? Or which one should win (package.json or jamrc) ?

Contributor

clexit commented Oct 12, 2012

I think they should be merged and package.json should have a priority over .jamrc.

@caolan, what do you think?

Owner

caolan commented Oct 12, 2012

package.json and .jamrc are supposed to serve two different purposes. Package.json is for package-related metadata and jamrc is for environment-specific data. They should not be merged or be interchangable. The question is whether repositories are environment-specific or package-specific. I think repositories should be configurable as part of your environment so you can replace packages with your own versions when necessary, even if you're not the author of the package you are installing. This would be in line with the way package managers work on most popular linux distros for example.

Owner

caolan commented Oct 12, 2012

How about having jam look in the project directory for a .jamrc and using that to override values in the .jamrc in $HOME by default? Would that solve your problem and avoid people having to manage project-specific environment variables?

Contributor

mmikulicic commented Oct 12, 2012

Yes, that would solve my scenario

Owner

caolan commented Oct 12, 2012

@mmikulicic I'm busy this weekend, but I'm happy to look into adding that sometime next week. I'll leave this ticket open as a reminder. Thanks for all the pull requests btw 😄

Contributor

mmikulicic commented Mar 17, 2015

I guess this is obsolete :-) closing

@mmikulicic mmikulicic closed this Mar 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment