From cdbb73aa55fc12c783606aebf55b19427ad23a3e Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Mon, 23 Oct 2023 10:07:34 -0400 Subject: [PATCH] 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. --- .envrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.envrc b/.envrc index 3550a30f2de..b85b26d148b 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use flake +has nix && use flake