Directory based environment variable scope - how to implement?

前端 未结 7 513
庸人自扰
庸人自扰 2021-02-04 00:03

I have a set of tools which I need to pass parameters depending on the project I\'m working on. I\'d like to be able to automatically set a couple of environment variables based

7条回答
  •  野性不改
    2021-02-04 00:32

    There is direnv which helps you do this stuff much easily and in an elegant way. Just define a .envrc file in your project directory with all the env variables needed and it will source it once you cd into that folder.

提交回复
热议问题