]> Sergey Matveev's repositories - nnn.git/commitdiff
Remove unneeded check from checksum plugin
authorath3 <ha05190@protonmail.com>
Thu, 27 Jun 2019 00:42:27 +0000 (02:42 +0200)
committerath3 <ha05190@protonmail.com>
Thu, 27 Jun 2019 00:48:04 +0000 (02:48 +0200)
plugins/checksum

index 488f9f686ac08c99afd41c38a498040aa80f6b02..d593a47295ae55e60c97e5bfe6fa7e0b93203ffc 100755 (executable)
@@ -15,7 +15,6 @@
 selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
 resp=f
 chsum=md5
-ischksum=0
 
 checksum_type()
 {
@@ -49,16 +48,13 @@ else
         for chks in md5 sha1 sha224 sha256 sha384 sha512
         do
             if [ "$(echo "$1" | grep \.${chks}$)" ]; then
-                ischksum=1
                 ${chks}sum -c < "$1"
                 read
                 exit
             fi
         done
-        if [ $ischksum -eq 0 ]; then
-            checksum_type
-            file=$(basename "$1").$chsum
-            ${chsum}sum "$1" > "$file"
-        fi
+        checksum_type
+        file=$(basename "$1").$chsum
+        ${chsum}sum "$1" > "$file"
     fi
 fi