nixos-option: fix #47722 when missing ~/.nix-defexpr/channels

The problem was that the non-fatal warning was not omitted
from the output when constructing a nix expression.
Now it seems OK for me.  When return code is OK,
the warnings don't get passed anywhere, but I expect
that won't matter for this utility.  Fatal errors are still shown.
This commit is contained in:
Vladimír Čunát 2018-10-04 16:52:17 +02:00
parent 0a7e258012
commit de93b32f90
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -82,7 +82,7 @@ evalNix(){
set -e
if test $exit_code -eq 0; then
cat <<EOF
sed '/^warning: Nix search path/d' <<EOF
$result
EOF
return 0;
@ -90,7 +90,7 @@ EOF
sed -n '
/^error/ { s/, at (string):[0-9]*:[0-9]*//; p; };
/^warning: Nix search path/ { p; };
' <<EOF
' >&2 <<EOF
$result
EOF
exit_code=1