about summary refs log tree commit diff stats
path: root/modules/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name')
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/archive_decompress.sh24
1 files changed, 10 insertions, 14 deletions
diff --git a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh
index 0e99b98e..142ac4d2 100755
--- a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh
+++ b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh
@@ -11,19 +11,15 @@ id="$id"
 
 set -f
 
-unarchive() {
-    case "$1" in
-    *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar --extract --bzip2 --verbose --file="$1" ;;
-    *.tar.gz | *.tgz) tar --extract --gzip --verbose --file="$1" ;;
-    *.tar.xz | *.txz) tar --extract --xz --verbose --file="$1" ;;
-    *.tar*) tar --extract --verbose --file="$1" ;;
-    *.zip) unzip "$1" ;;
-    *.7z) 7z x "$1" ;;
-    *) die "'$1' is not a supported file for unarchiving." ;;
+echo "$fx" | while read -r file; do
+    case "$file" in
+    *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar --extract --bzip2 --verbose --file="$file" ;;
+    *.tar.gz | *.tgz) tar --extract --gzip --verbose --file="$file" ;;
+    *.tar.xz | *.txz) tar --extract --xz --verbose --file="$file" ;;
+    *.tar*) tar --extract --verbose --file="$file" ;;
+    *.zip) unzip "$file" ;;
+    *.7z) 7z x "$file" ;;
+    *) die "'$file' is not a supported file for unarchiving." ;;
     esac
-}
-
-while read -r file; do
-    unarchive "$file"
-done <"$fx"
+done
 # vim: ft=sh