From 8d8d4d897843e5116e03bc198eccb909c513e98d Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Sat, 30 May 2026 09:36:09 +0200 Subject: [PATCH] added echo error on `ignored` when ignored packages file does not exist --- pman.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pman.sh b/pman.sh index 284a930..4cc9f14 100755 --- a/pman.sh +++ b/pman.sh @@ -48,6 +48,11 @@ elif [ "$command_args" = "reflector" ]; then fi su_needed=true elif [ "$command_args" = "ignored" ]; then + if [ ! -f "$ignoredpkgs_file" ]; then + echo "Error: $ignoredpkgs_file does not exist, no packages ignored" >&2 + echo "use $0 ignore to start" >&2 + exit 1 + fi command="echo" command_args="$(cat $ignoredpkgs_file | sed 's/IgnorePkg = //' | sort)" elif [ "$command_args" = "ignore" ]; then @@ -63,6 +68,11 @@ elif [ "$command_args" = "ignore" ]; then done exit 0 elif [ "$command_args" = "unignore" ]; then + if [ ! -f "$ignoredpkgs_file" ]; then + echo "Error: $ignoredpkgs_file does not exist, no packages ignored" >&2 + echo "use $0 ignore to start" >&2 + exit 1 + fi for pkg in "${@}"; do command="sed" su_needed=true