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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user