From 15a53d1746308dcb035e671c13b82fd69b027d91 Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Thu, 14 Mar 2024 13:54:32 +0100 Subject: [PATCH] docs: mention watch_file in direnv usage (#983) --- docs/environment.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/environment.md b/docs/environment.md index b3212870e..43e54a8b2 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -107,10 +107,12 @@ This allows you to use `pixi` in combination with `direnv`. Enter the following into your `.envrc` file: ```shell title=".envrc" -eval "$(pixi shell-hook)" # (1)! +watch_file pixi.lock # (1)! +eval "$(pixi shell-hook)" # (2)! ``` -1. This installs if needed, and activates the environment. `direnv` ensures that the environment is deactivated when you leave the directory. +1. This ensures that every time your `pixi.lock` changes, `direnv` invokes the shell-hook again. +2. This installs if needed, and activates the environment. `direnv` ensures that the environment is deactivated when you leave the directory. ```shell $ cd my-project