Skip to content

Commit 6ff05d0

Browse files
mohsenariLagojaLucilleH
authored
[docs] Updated direnv docs to reflect update after v0.5.0 (#1080)
## Summary Title + added link to direnv extension for vscode Addresses: #1078 ## How was it tested? N/A --------- Signed-off-by: John Lago <[email protected]> Co-authored-by: John Lago <[email protected]> Co-authored-by: Lucille Hua <[email protected]>
1 parent e7ab1c6 commit 6ff05d0

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

docs/app/docs/ide_configuration/direnv.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ If you see any errors when activating your `.envrc` file, you will need to run `
2020

2121
#### New Project
2222

23-
If you have direnv installed, Devbox will generate an .envrc file when you run `devbox init` and enables it by running `direnv allow` in the background:
23+
If you have direnv installed, Devbox will generate an .envrc file when you run `devbox generate direnv` and enables it by running `direnv allow` in the background:
2424

2525
```bash
26-
➜ devbox init
26+
➜ devbox generate direnv
27+
Success: generated .envrc file
28+
Success: ran `direnv allow`
2729
direnv: loading ~/src/devbox/docs/.envrc
2830
direnv: using devbox
2931
```
3032

31-
This will generate a `.envrc` file in your root directory along with your `devbox.json`, you can run `direnv allow` so that your shell will activate whenever you navigate to the directory
32-
or `direnv revoke` to stop.
33+
This will generate a `.envrc` file in your project directory that contains `devbox.json`. Run `direnv allow` to activate your shell upon directory navigation. Run `direnv revoke` to stop. Changes to `devbox.json` automatically trigger direnv to reset the environment.
3334

3435

3536
#### Existing Project
@@ -38,6 +39,8 @@ For an existing project, you can add a `.envrc` file by running `devbox generate
3839

3940
```bash
4041
➜ devbox generate direnv
42+
Success: generated .envrc file
43+
Success: ran `direnv allow`
4144
direnv: loading ~/src/devbox/docs/.envrc
4245
direnv: using devbox
4346
```
@@ -53,6 +56,14 @@ Alternatively, a project directory can be whitelisted so that changes will be au
5356
prefix = [ "/absolute/path/to/project" ]
5457

5558
```
56-
<!-- TODO: add steps for vscode integration -->
59+
60+
### VSCode setup with direnv
61+
62+
To seamlessly integrate VSCode with a direnv environment, follow these steps:
63+
64+
1. Open a terminal window and activate direnv with `direnv allow`.
65+
2. Launch VSCode from the same terminal window using the command `code .` This ensures that VSCode inherits the direnv environment.
66+
67+
Alternatively, you can use the [direnv VSCode extension](https://marketplace.visualstudio.com/items?itemName=mkhl.direnv) if your VSCode workspace has a .envrc file.
5768

5869
If this guide is missing something, feel free to contribute by opening a [pull request](https://github.com/jetpack-io/devbox/pulls) in Github.

0 commit comments

Comments
 (0)