From 176c458e2b92ca1ec4455187b5cce10cb8ec5996 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Tue, 12 Mar 2024 20:52:58 +0300 Subject: [PATCH] Archive : Skip unarchive if not an archive. --- module/common/bash/module/Archive.sh | 4 ++++ module/common/bash/module/Util.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/common/bash/module/Archive.sh b/module/common/bash/module/Archive.sh index a1725eb..f8c3746 100644 --- a/module/common/bash/module/Archive.sh +++ b/module/common/bash/module/Archive.sh @@ -234,6 +234,10 @@ function unarchive() { process() { # Validate. # _archive_check "${target}" || return 1 + if ! _is_archive "${target}"; then + _iterate_skip "Not an archive." + return 0 + fi # Remote archives. local remote diff --git a/module/common/bash/module/Util.sh b/module/common/bash/module/Util.sh index 4c6cedd..4413a9e 100644 --- a/module/common/bash/module/Util.sh +++ b/module/common/bash/module/Util.sh @@ -69,7 +69,7 @@ function _iterate_targets() { function _iterate_skip() { ((skipped++)) - [[ "${*}" = "" ]] || echo -e "${color_byellow}${*}${color_default}" + [[ "${*}" != "" ]] && echo -e "${color_byellow}${*}${color_default}" } # Report an error.