mirror of
https://gitlab.com/rensa-nix/direnv.git
synced 2025-12-12 10:00:11 +01:00
feat: use nested gitignore to automatically make git ignore state dir
This commit is contained in:
parent
8df328f610
commit
9c4f8a20e4
2 changed files with 10 additions and 0 deletions
|
|
@ -7,9 +7,16 @@ direnv fetchurl https://gitlab.com/rensa-nix/direnv/-/raw/main/direnvrc
|
||||||
```
|
```
|
||||||
|
|
||||||
`.envrc`:
|
`.envrc`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
source $(fetchurl https://gitlab.com/rensa-nix/direnv/-/raw/main/direnvrc <hash>)
|
source $(fetchurl https://gitlab.com/rensa-nix/direnv/-/raw/main/direnvrc <hash>)
|
||||||
|
|
||||||
use envreload //repo/shells/default
|
use envreload //repo/shells/default
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Formatting & Linting
|
||||||
|
|
||||||
|
```sh
|
||||||
|
shfmt -w -i 2 direnvrc
|
||||||
|
shellcheck direnvrc
|
||||||
|
```
|
||||||
|
|
|
||||||
3
direnvrc
3
direnvrc
|
|
@ -111,6 +111,9 @@ __ren_init_project() {
|
||||||
mkdir -p "${REN_STATE}/direnv"
|
mkdir -p "${REN_STATE}/direnv"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
direnv_layout_dir="${REN_STATE}/direnv"
|
direnv_layout_dir="${REN_STATE}/direnv"
|
||||||
|
|
||||||
|
# add nested gitignore which ignores the whole state dir
|
||||||
|
echo "**/*" >"$REN_STATE/.gitignore"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue