Update file.py

This commit is contained in:
dami
2025-09-14 14:46:45 +08:00
parent 4b4d21a0de
commit ad5fc52d66
+5 -2
View File
@@ -147,8 +147,8 @@ def uncompress(sfile, dfile, path):
if suffix_gz == tar_gz:
extension = suffix_gz
if not extension in ['tar.gz', 'gz', 'zip', 'rar', '7z']:
return mw.returnData(False, '现在仅支持gz,zip,rar格式解压!')
if not extension in ['tar.gz', 'gz', 'zip', 'rar', '7z', 'xz']:
return mw.returnData(False, '现在仅支持gz,zip,rar,7z,xz格式解压!')
if extension == 'rar' and not mw.checkBinExist('rar'):
return mw.returnData(False, 'rar解压命令不存在,请安装!')
@@ -174,6 +174,9 @@ def uncompress(sfile, dfile, path):
elif extension == '7z':
cmd += "&& 7z x " + sfile + " -r -o" + dfile + " > " + tmps + " 2>&1 &"
mw.execShell(cmd)
elif extension == 'xz':
cmd += "&& tar -xvJf " + sfile + " -r -o" + dfile + " > " + tmps + " 2>&1 &"
mw.execShell(cmd)
if os.path.exists(dfile):
if dfile.startswith("/www/wwwroot"):