2 [[ -v AUR_DEBUG
]] && set -o xtrace
6 # Helper function to take complements of pkgbase arrays
7 filter_packages
() { grep -Fxvf <(printf '%s\n' "$@") -; }
9 # Directory with diffs and PKGBUILD subdirs
11 diffs
=(@
(*.
diff|
*.log
))
13 pkgbases
=("${pkgbases[@]%/}")
15 # Show diffs in 2 panes
16 if [[ -f ${diffs[0]} ]]; then
17 cat "${diffs[@]}" | delta
--diff-so-fancy --paging=always
--line-numbers --navigate
19 # Remove diffs from remaining targets (new or unchanged dirs)
20 mapfile
-t pkgbases
< <(
21 printf '%s\n' "${pkgbases[@]}" | filter_packages
"${diffs[@]%%.*}")
24 # Show remaining targets in a concatenated fashion
25 if (( ${#pkgbases[@]} )); then
26 # Only print files in the git repository
27 find -L "${pkgbases[@]}" -prune -exec sh
-c 'git -C {} ls-files -z | env -C {} xargs -0r realpath -z' \
; |
28 grep -Ezv '.SRCINFO|.gitignore' |
xargs -0r bat
--paging=always
32 read -rp $
'Press Return to continue or Ctrl+d to abort\n'