Direnv: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://direnv.net/ =Internal= * Linux =Overview=")
 
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
* [[Linux]]
* [[Linux]]
=Overview=
=Overview=
=Installation=
<syntaxhighlight lang='bash'>
brew install direnv
</syntaxhighlight>
=Configuration=
{{External|https://direnv.net/docs/hook.html#bash}}
Add to <code>.bashrc</code>:
<syntaxhighlight lang='bash'>
eval "$(direnv hook bash)"
</syntaxhighlight>
=Configuration=
Create an <code>.envrc</code> file in the directory in question:
<syntaxhighlight lang='bash'>
export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
PATH_add "${JAVA_HOME}/bin"
</syntaxhighlight>

Latest revision as of 02:18, 16 February 2022

External

Internal

Overview

Installation

brew install direnv

Configuration

https://direnv.net/docs/hook.html#bash

Add to .bashrc:

eval "$(direnv hook bash)"

Configuration

Create an .envrc file in the directory in question:

export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
PATH_add "${JAVA_HOME}/bin"