gscripts/blogv
Robert Morrison f4a84d9358
feat(blogv): Add blogv
Add blogv the dumb build log viewer to the repo
NOTE: I also remove the extraneous readme.html that accidentally got
committed
2024-08-16 02:09:41 +01:00

21 lines
637 B
Bash
Executable File

#!/bin/bash
# +SPDX:MIT
# A dumb portage build log viewer
# Currently relies on logging being done in a specific way.
# all arguments are sent to bat
## WE NEED SOME DEPENDENCIES
depcheck() {
if ! command -v "$1" &> /dev/null ; then
echo "Missing dependency $1"
exit 1
fi
}
depcheck fzf
depcheck bat
depcheck xargs
# in true unix style this is just a long pipe of pipes
# shellcheck disable=2068
find /var/log/portage/build -type f -iname "*.log" | sed -e 's|/var/log/portage/build/||' -e 's/:.*//' | sort | uniq | fzf | xargs --no-run-if-empty --replace={} find /var/log/portage/build -iwholename "*{}*" | sort | xargs bat ${@}