Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: copyyedit docs/dev/how-to-use-direnv.md #10002

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/dev/how-to-use-direnv.md
@@ -1,28 +1,29 @@
# How to use direnv

As a developer, it can be better not to think too much about setting right env variables as you enter a project.
As a developer, it can be better not to think too much about setting the right env variables as you enter a project.
[`direnv`](https://direnv.net/) aims at providing a solution.

As a quick guide as an openfoodfacts developer:

- install direnv on your system using usual package manager
- install direnv on your system using the usual package manager
- in your .bashrc add:
```bash
# direnv
eval "$(direnv hook bash)"
```
you have adapt the direnv line according to what you use, see [direnv doc](https://direnv.net/docs/hook.html)
- In your project directory add a file, where you superseed variables from `.env`
that you wan't to
You have to adapt the direnv line according to what you use; see [direnv doc](https://direnv.net/docs/hook.html).
- in your project directory add a file, where you override variables from `.env`
that you want to:

```
echo "setting up docker compose env"
export DOCKER_BUILDKIT=1
# The next two lines do the same thing in different ways; choose one.
export USER_UID=${UID}
export USER_UID=$(id -g)
```

- in project directory, run `direnv allow .`
- in your project directory, run `direnv allow .`
- in a new shell:
- go in project directory
- you should have direnv trigger and load your variables
- go to the project directory
- direnv should trigger and load your variables