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

Cater for environment switch #7

Open
azukaar opened this issue Jun 5, 2019 · 0 comments
Open

Cater for environment switch #7

azukaar opened this issue Jun 5, 2019 · 0 comments

Comments

@azukaar
Copy link
Owner

azukaar commented Jun 5, 2019

When reading configuration or dependency lists, gupm should read the GUPM_ENV environment variable, and choose a config to override the default one.

{
   "config" | "dependencies": {
      "default" : {
         "brew://node": "9"
      },
      "ci" : {
         "brew://node": "11"
      },
      "dev": {
         "brew://node": "12"
      }
   }
}

With this configuration, this will install node@12 :

g env GUPM_ENV=dev g make 

The differents values are: default, overwritten by :

  • ci
  • dev
  • integration
  • production

OS

You can also switch by OS:

{
   "config" | "dependencies": {
      "default" : {
         "brew://node": "9"
      },
      "windows" : {
         "brew://node": "11"
      },
}

And finally, by OS, by env:

{
   "config" | "dependencies": {
      "default" : {
         "brew://node": "9"
      },
      "dev@windows" : {
         "brew://node": "11"
      },
}

The order of overwrite follows the rule of most-precise-first :

  • default
  • dev
  • windows_dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant