Prevent direnv errors when not using nix (#16875)

Right now, if a developer uses `direnv` but does not use `nix`, an error
is reported whenever changing into the OpenAPI generator directory:

```console
$ cd ~/oss/forks/openapi-generator
direnv: loading ~/oss/forks/openapi-generator/.envrc
direnv: using flake
environment:1270: nix: command not found
```

This uses the `has()` function to check for `nix` to *conditionally* run
the `use_flake` function.
This commit is contained in:
Austin Ziegler 2023-10-23 10:07:34 -04:00 committed by GitHub
parent ae590c4712
commit cdbb73aa55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
.envrc
View File

@ -1 +1 @@
use flake
has nix && use flake