Table of Contents

direnv可用來設定Project的environment variable
當cd進project目錄時自動設定環境變數,離開時自動unload
非常好用

https://github.com/direnv/direnv

1 Install

for mac:

brew install direnv

add following to .bash_profile:

eval "$(direnv hook bash)"

2 Usage

Add .envrc file at Project root directory

export PYTHONDONTWRITEBYTECODE=1
export env=dev

run direnv allow .

Last Updated 2017-03-10 五 10:26.
Render by hexo-renderer-org with Emacs 25.2.1 (Org mode 8.2.10)