please shellcheck

This commit is contained in:
Daylin Morgan 2022-11-14 11:40:05 -06:00
parent e531d5ec48
commit eb3a1f6cc2

View file

@ -18,13 +18,13 @@ header() {
updates_output() { updates_output() {
notify=$1 notify=$1
if ! [[ -z $updates_arch ]]; then if [[ -n $updates_arch ]]; then
header header
echo "ARCH: $(echo "$updates_arch" | wc -l)" echo "ARCH: $(echo "$updates_arch" | wc -l)"
header header
[[ -z $notify ]] && echo "$updates_arch" [[ -z $notify ]] && echo "$updates_arch"
fi fi
if ! [[ -z $updates_aur ]]; then if [[ -n $updates_aur ]]; then
header header
echo "AUR: $(echo "$updates_aur" | wc -l)" echo "AUR: $(echo "$updates_aur" | wc -l)"
header header
@ -35,7 +35,7 @@ updates_output() {
update_system() { update_system() {
echo echo
read -p "Would you like to update? (y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 read -r -p "Would you like to update? (y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
pikaur -Syu --noedit --nodiff pikaur -Syu --noedit --nodiff
} }
@ -48,7 +48,7 @@ for opt in "$@"; do
notify=1 notify=1
shift shift
;; ;;
-* | --*) -*)
echo "Invalid option: $opt" echo "Invalid option: $opt"
usage usage
exit 1 exit 1
@ -68,10 +68,10 @@ if [[ -z $updates_info ]]; then
exit 0 exit 0
fi fi
if ! [[ -z $notify ]]; then if [[ -n $notify ]]; then
notify-send -w "System Updates Available!" "$updates_info" notify-send -w "System Updates Available!" "$updates_info"
else else
echo "System Updates Available!" echo "nystem Updates Available!"
echo "$updates_info" echo "$updates_info"
update_system update_system
fi fi