diff options
| author | pml68 <contact@pml68.dev> | 2025-08-08 23:54:59 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-08-08 23:54:59 +0200 |
| commit | 516de7e0b883f733b0a95c1533d90746aa7b2fd9 (patch) | |
| tree | 525415079eced7643693335a406f5882ce2a5873 | |
| parent | feat: enable ShellCheck analysis (diff) | |
| download | aur-516de7e0b883f733b0a95c1533d90746aa7b2fd9.tar.gz | |
feat: do a diff check after changes / open PKGBUILD in editor for new pkg
| -rwxr-xr-x | aur | 29 |
1 files changed, 24 insertions, 5 deletions
@@ -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 } |
