Skip to content

Commit

Permalink
nixos-option: fix #47722 when missing ~/.nix-defexpr/channels
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit de93b32)
  • Loading branch information
vcunat committed Oct 4, 2018
1 parent c02f213 commit c78e3b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/installer/tools/nixos-option.sh
Expand Up @@ -82,15 +82,15 @@ evalNix(){
set -e

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

0 comments on commit c78e3b7

Please sign in to comment.