added ability of extracting .7z files (#144)

This commit is contained in:
Dev Singh Rajput 2020-07-29 20:52:39 +05:30 committed by lzzy12
parent 0288770ec4
commit 009746aa01
2 changed files with 7 additions and 0 deletions

View File

@ -74,6 +74,8 @@ def get_base_name(orig_path: str):
return orig_path.replace(".tgz", "")
elif orig_path.endswith(".zip"):
return orig_path.replace(".zip", "")
elif orig_path.endswith(".7z"):
return orig_path.replace(".7z", "")
elif orig_path.endswith(".Z"):
return orig_path.replace(".Z", "")
elif orig_path.endswith(".rar"):

View File

@ -42,6 +42,11 @@ extract() {
7z x "$arg" -o"$a_dir"
local code=$?
;;
*.7z)
a_dir=$(expr "$arg" : '\(.*\).7z')
7z x "$arg" -o"$a_dir"
local code=$?
;;
*.Z)
uncompress "$arg"
local code=$?