Skip to content

Prevent direnv errors when not using nix#16875

Merged
wing328 merged 1 commit intoOpenAPITools:masterfrom
halostatue:prevent-direnv-errors-when-not-using-flake
Oct 23, 2023
Merged

Prevent direnv errors when not using nix#16875
wing328 merged 1 commit intoOpenAPITools:masterfrom
halostatue:prevent-direnv-errors-when-not-using-flake

Conversation

@halostatue
Copy link
Contributor

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

$ 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.

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.
@wing328 wing328 merged commit cdbb73a into OpenAPITools:master Oct 23, 2023
@wing328 wing328 added this to the 7.1.0 milestone Oct 23, 2023
@halostatue halostatue deleted the prevent-direnv-errors-when-not-using-flake branch October 23, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants