Update file.py

This commit is contained in:
dami
2026-07-20 23:07:46 +08:00
parent 6ed045cf94
commit fe13ab1e5f
+4 -1
View File
@@ -147,7 +147,7 @@ def uncompress(sfile, dfile, path):
if suffix_gz == tar_gz:
extension = suffix_gz
if not extension in ['tar.gz', 'gz', 'zip', 'rar', '7z', 'xz','bz2']:
if not extension in ['tar.gz', 'tgz','gz', 'zip', 'rar', '7z', 'xz','bz2']:
return mw.returnData(False, '现在仅支持gz,zip,rar,7z,xz,bz2格式解压!')
if extension == 'rar' and not mw.checkBinExist('rar'):
@@ -165,6 +165,9 @@ def uncompress(sfile, dfile, path):
elif extension == 'tar.gz':
cmd += "&& tar -zxvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &"
mw.execShell(cmd)
elif extension == 'tgz':
cmd += "&& tar -zxvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &"
mw.execShell(cmd)
elif extension == 'gz':
cmd += "&& gunzip -k " + sfile + " > " + tmps + " 2>&1 &"
mw.execShell(cmd)