OSDN Git Service

[clean] : Optimized processing
authorhayao <shun819.mail@gmail.com>
Wed, 30 Sep 2020 08:57:51 +0000 (17:57 +0900)
committerhayao <shun819.mail@gmail.com>
Wed, 30 Sep 2020 08:57:51 +0000 (17:57 +0900)
tools/channel.sh

index 18c9bf0..707c356 100755 (executable)
@@ -66,17 +66,11 @@ check() {
     fi
     if [[ $(printf '%s\n' "${channellist[@]}" | grep -qx "${1}"; echo -n ${?} ) -eq 0 ]]; then
         echo "true"
-    elif [[ -d "${1}" ]]; then
-        if [[ -n $(ls "${1}") ]] && [[ "$(cat "${1}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] || [[ "${opt_nochkver}" = true ]]; then
+    elif [[ -d "${1}" ]] && [[ -n $(ls "${1}") ]] && [[ "$(cat "${1}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] || [[ "${opt_nochkver}" = true ]]; then
             local _channel_name="$(basename "${1%/}")"
-            if [[ ! "${_channel_name}" = "share" ]]; then
-                if [[ $(echo "${_channel_name}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]] || [[ ! -d "${script_path}/channels/${_dirname}.add" ]] && [[ "${opt_only_add}" = false ]]; then
-                    echo "true"
-                fi
+            if [[ ! "${_channel_name}" = "share" ]] && [[ $(echo "${_channel_name}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]] || [[ ! -d "${script_path}/channels/${_dirname}.add" ]] && [[ "${opt_only_add}" = false ]]; then
+                echo "true"
             fi
-        else
-            echo "false"
-        fi
     else
         echo "false"
     fi