diff --git a/.local/bin/aurb b/.local/bin/aurb index 6efb036..c881ba0 100755 --- a/.local/bin/aurb +++ b/.local/bin/aurb @@ -31,3 +31,13 @@ aur "$cmd" \ --bind-rw "$THINLTO_HOST_DIR" \ --bind "$HOME/.config/aurb" \ "${args[@]}" +status=$? + +# After a successful sync, drop downloaded sources and logs from the AUR clones. Without -d, +# git clean keeps untracked directories, so VCS sources (bare clones) survive. +if [[ $cmd == sync && $status -eq 0 ]]; then + for clone in "${AURDEST:-${XDG_CACHE_HOME:-$HOME/.cache}/aurutils/sync}"/*/; do + [[ -d $clone.git ]] && git -C "$clone" clean -fxq + done +fi +exit "$status"