Clean downloaded sources from AUR clones after aurs

After a successful sync, aurb runs git clean -fx in each clone under the aurutils sync folder, removing downloaded sources and build logs while keeping tracked files and VCS source folders.
This commit is contained in:
Daniele Fucini
2026-10-24 22:17:23 +02:00
parent 638f7e3dd9
commit ffe2039de5
+10
View File
@@ -31,3 +31,13 @@ aur "$cmd" \
--bind-rw "$THINLTO_HOST_DIR" \ --bind-rw "$THINLTO_HOST_DIR" \
--bind "$HOME/.config/aurb" \ --bind "$HOME/.config/aurb" \
"${args[@]}" "${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"