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:
parent
0a7e258012
commit
de93b32f90
@ -82,7 +82,7 @@ evalNix(){
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if test $exit_code -eq 0; then
|
if test $exit_code -eq 0; then
|
||||||
cat <<EOF
|
sed '/^warning: Nix search path/d' <<EOF
|
||||||
$result
|
$result
|
||||||
EOF
|
EOF
|
||||||
return 0;
|
return 0;
|
||||||
@ -90,7 +90,7 @@ EOF
|
|||||||
sed -n '
|
sed -n '
|
||||||
/^error/ { s/, at (string):[0-9]*:[0-9]*//; p; };
|
/^error/ { s/, at (string):[0-9]*:[0-9]*//; p; };
|
||||||
/^warning: Nix search path/ { p; };
|
/^warning: Nix search path/ { p; };
|
||||||
' <<EOF
|
' >&2 <<EOF
|
||||||
$result
|
$result
|
||||||
EOF
|
EOF
|
||||||
exit_code=1
|
exit_code=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user