mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
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.
(cherry picked from commit de93b32f90)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user