From e7df598cd0addefb51b678a2a4b1607942f153e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 30 Sep 2019 17:15:28 +0100 Subject: [PATCH] fix environment variable dump extraction Grep does not work across multiple lines. However the output of direnv is on a single anyway. --- direnvrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direnvrc b/direnvrc index dd2db9a..ac7edc8 100644 --- a/direnvrc +++ b/direnvrc @@ -17,9 +17,9 @@ use_nix() { [[ shell.nix -nt "$cache" ]]; then [ -d .direnv ] || mkdir .direnv - local dump_cmd="echo \; \"$direnv\" dump bash; echo \" + local dump_cmd="echo -n _____direnv_____; \"$direnv\" dump bash" local tmp=$(nix-shell --show-trace --pure "$@" \ - --run "$dump_cmd" | grep -oP '(?<=).*?(?=)') + --run "$dump_cmd" | grep -oP '(?<=_____direnv_____).*') echo "$tmp" > "$cache" update_drv=1 else