diff options
| author | pml68 <contact@pml68.dev> | 2025-08-21 15:37:22 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-08-21 15:37:22 +0200 |
| commit | c8d972261b3d536298cc10e36b1ab5153f2adc57 (patch) | |
| tree | c00601c7ac149973399062a9e4022a74d144d6d3 | |
| parent | feat: do a diff check after changes / open PKGBUILD in editor for new pkg (diff) | |
| download | aur-c8d972261b3d536298cc10e36b1ab5153f2adc57.tar.gz | |
feat: `set -eu`
| -rwxr-xr-x | aur | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,5 +1,7 @@ #!/bin/bash +set -eu + _help() { echo "Usage: $(basename "$0") [OPTIONS]" echo "" @@ -13,14 +15,14 @@ _help() { echo " -h, --help Display this help text." echo " [nothing] Check all packages for updates." echo "" - exit "$1" + exit "${1-0}" } _update() { for dir in ~/.aur/*; do cd "$dir" || continue - if [[ $(git pull) != "Already up to date." ]] || [[ $1 == "-f" ]] || [[ "$dir" == *-git && $1 == "-g" ]]; then + 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 @@ -60,8 +62,8 @@ _update_or_install() { done } -if [[ -n $1 ]]; then - case $1 in +if [[ -n "${1-}" ]]; then + case "$1" in --list | -l) pacman -Qm ;; |
