aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-08-21 15:37:22 +0200
committerpml68 <contact@pml68.dev>2025-08-21 15:37:22 +0200
commitc8d972261b3d536298cc10e36b1ab5153f2adc57 (patch)
treec00601c7ac149973399062a9e4022a74d144d6d3
parentfeat: do a diff check after changes / open PKGBUILD in editor for new pkg (diff)
downloadaur-c8d972261b3d536298cc10e36b1ab5153f2adc57.tar.gz
feat: `set -eu`
-rwxr-xr-xaur10
1 files changed, 6 insertions, 4 deletions
diff --git a/aur b/aur
index 570784f..af953c4 100755
--- a/aur
+++ b/aur
@@ -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
;;