nixos-option: Improve error messages to avoid reporting internal location and traces.

This commit is contained in:
Nicolas B. Pierron 2014-12-19 23:00:52 +01:00
parent b2abfe54b3
commit cd2f7ce9f9

View File

@ -69,7 +69,18 @@ fi
#############################
evalNix(){
nix-instantiate - --eval-only "$@"
result=$(nix-instantiate - --eval-only "$@" 2>&1)
if test $? -eq 0; then
cat <<EOF
$result
EOF
return 0;
else
sed -n '/error/ { s/, at (string):[0-9]*:[0-9]*//; p; }' <<EOF
$result
EOF
return 1;
fi
}
evalAttr(){