aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-08-08 23:54:59 +0200
committerpml68 <contact@pml68.dev>2025-08-08 23:54:59 +0200
commit516de7e0b883f733b0a95c1533d90746aa7b2fd9 (patch)
tree525415079eced7643693335a406f5882ce2a5873
parentfeat: enable ShellCheck analysis (diff)
downloadaur-516de7e0b883f733b0a95c1533d90746aa7b2fd9.tar.gz
feat: do a diff check after changes / open PKGBUILD in editor for new pkg
-rwxr-xr-xaur29
1 files changed, 24 insertions, 5 deletions
diff --git a/aur b/aur
index ac9da94..570784f 100755
--- a/aur
+++ b/aur
@@ -18,10 +18,14 @@ _help() {
_update() {
for dir in ~/.aur/*; do
- [[ -e "$dir" ]] || break
+ cd "$dir" || continue
- if [[ $(cd "$dir" && git pull) != "Already up to date." ]] || [[ $1 == "-f" ]] || [[ "$dir" == *-git && $1 == "-g" ]]; then
- (cd "$dir" && makepkg -si ; _clean)
+ if [[ $(git pull) != "Already up to date." ]] || [[ $1 == "-f" ]] || [[ "$dir" == *-git && $1 == "-g" ]]; then
+ git diff "@{1}.."
+ read -p "Proceed with installation? [Y/n] " proceed
+ if [[ -z "$proceed" ]] || [[ "$proceed" == "Y" ]] || [[ "$proceed" == "y" ]]; then
+ makepkg -si ; _clean
+ fi
fi
done
}
@@ -34,9 +38,24 @@ _clean() {
_update_or_install() {
for package in "$@"; do
if cd ~/.aur/"$package"; then
- (git pull && makepkg -si ; _clean)
+ local proceed=""
+
+ if [[ $(git pull) != "Already up to date." ]]; then
+ git diff "@{1}.."
+ read -p "Proceed with installation? [Y/n] " proceed
+ fi
+
+ if [[ -z "$proceed" ]] || [[ "$proceed" == "Y" ]] || [[ "$proceed" == "y" ]]; then
+ makepkg -si ; _clean
+ fi
else
- (git clone "https://aur.archlinux.org/$package" ~/.aur/"$package" && cd ~/.aur/"$package" && makepkg -si ; _clean)
+ git clone "https://aur.archlinux.org/$package" ~/.aur/"$package"
+ cd ~/.aur/"$package" || continue
+ ${EDITOR:-nvim} PKGBUILD
+ read -p "Proceed with installation? [Y/n] " proceed
+ if [[ -z "$proceed" ]] || [[ "$proceed" == "Y" ]] || [[ "$proceed" == "y" ]]; then
+ makepkg -si ; _clean
+ fi
fi
done
}