You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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]>
Copy file name to clipboardExpand all lines: docs/app/docs/ide_configuration/direnv.md
+16-5Lines changed: 16 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,16 +20,17 @@ If you see any errors when activating your `.envrc` file, you will need to run `
20
20
21
21
#### New Project
22
22
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:
24
24
25
25
```bash
26
-
➜ devbox init
26
+
➜ devbox generate direnv
27
+
Success: generated .envrc file
28
+
Success: ran `direnv allow`
27
29
direnv: loading ~/src/devbox/docs/.envrc
28
30
direnv: using devbox
29
31
```
30
32
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.
33
34
34
35
35
36
#### Existing Project
@@ -38,6 +39,8 @@ For an existing project, you can add a `.envrc` file by running `devbox generate
38
39
39
40
```bash
40
41
➜ devbox generate direnv
42
+
Success: generated .envrc file
43
+
Success: ran `direnv allow`
41
44
direnv: loading ~/src/devbox/docs/.envrc
42
45
direnv: using devbox
43
46
```
@@ -53,6 +56,14 @@ Alternatively, a project directory can be whitelisted so that changes will be au
53
56
prefix = [ "/absolute/path/to/project" ]
54
57
55
58
```
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.
57
68
58
69
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