summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmre AKYÜZ <emreakyuz_2@hotmail.com>2023-10-27 21:54:15 +0300
committerGitHub <noreply@github.com>2023-10-27 18:54:15 +0000
commitbca6b403eb61df8f36e543a95ea48a07e546a9d3 (patch)
tree0ec8666cc9448705703f655eebf45049b05bedc1
parent42f3efb4b0c57003d8c49e8e946948b458bea873 (diff)
downloadeibhear-bca6b403eb61df8f36e543a95ea48a07e546a9d3.tar.gz
eibhear-bca6b403eb61df8f36e543a95ea48a07e546a9d3.tar.zst
eibhear-bca6b403eb61df8f36e543a95ea48a07e546a9d3.zip
Unpack Function for LF Without Aunpack (#1334)
We can simply eliminate the usage of an external tool by adding a simple case statement to handle different types of compressed files.
-rw-r--r--.config/lf/lfrc17
1 files changed, 16 insertions, 1 deletions
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index 56a4182..e104591 100644
--- a/.config/lf/lfrc
+++ b/.config/lf/lfrc
@@ -58,7 +58,22 @@ cmd extract ${{
printf "%s\n\t" "$fx"
printf "extract?[y/N]"
read ans
- [ $ans = "y" ] && aunpack $fx
+ [ $ans = "y" ] && {
+ case $fx in
+ *.tar.bz2) tar xjf $fx ;;
+ *.tar.gz) tar xzf $fx ;;
+ *.bz2) bunzip2 $fx ;;
+ *.rar) unrar e $fx ;;
+ *.gz) gunzip $fx ;;
+ *.tar) tar xf $fx ;;
+ *.tbz2) tar xjf $fx ;;
+ *.tgz) tar xzf $fx ;;
+ *.zip) unzip $fx ;;
+ *.Z) uncompress $fx ;;
+ *.7z) 7z x $fx ;;
+ *.tar.xz) tar xf $fx ;;
+ esac
+ }
}}
cmd delete ${{