From 3504c811a55ecd58e0712cf24829c67c192f5e80 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 18 May 2021 15:07:30 +0200 Subject: Add testcase for `nix develop` with `__structuredAttrs` --- src/nix/get-env.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/nix/get-env.sh') diff --git a/src/nix/get-env.sh b/src/nix/get-env.sh index b6b8310a9..431440516 100644 --- a/src/nix/get-env.sh +++ b/src/nix/get-env.sh @@ -8,6 +8,9 @@ if [[ -n $stdenv ]]; then source $stdenv/setup fi +# In case of `__structuredAttrs = true;` the list of outputs is an associative +# array with a format like `outname => /nix/store/hash-drvname-outname`, so `__olist` +# must contain the array's keys (hence `${!...[@]}`) in this case. if [ -e .attrs.sh ]; then __olist="${!outputs[@]}" else @@ -16,10 +19,10 @@ fi for __output in $__olist; do if [[ -z $__done ]]; then - export > ${!__output} - set >> ${!__output} + export > "${!__output}" + set >> "${!__output}" __done=1 else - echo -n >> ${!__output} + echo -n >> "${!__output}" fi done -- cgit v1.2.3