Added helper script for analyzing simple errors

This commit is contained in:
Emile Clark-Boman 2025-07-19 23:19:39 +10:00
parent 6ccfdadeb5
commit 58065c0478

18
huhh.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
EXPR_MSG="evaluating derivation"
PROP_MSG="of derivation"
LOC=$1
if [ -z $1 ]; then
exec {1}<>"$LOC"
fi
ERROR_LINE=$(<$LOC grep -nF "error:" \
| tail -n1 \
| awk '{print substr($1,1,length($1)-1)}' )
<$LOC sed -n "$ERROR_LINE,\$p"
echo "[*] Reason:"
<$LOC grep "evaluating attribute '.*' of derivation" \
| awk '{ print substr($NF, 2, length($NF)-2), substr($5, 2, length($5)-2)}'