Update file.py

This commit is contained in:
dami 2025-09-14 15:01:04 +08:00
parent 17c60b6b4e
commit 0e8439d52b
1 changed files with 3 additions and 0 deletions

View File

@ -308,6 +308,9 @@ def zip(sfile, dfile, stype, path):
mw.execShell("cd '" + path + "' && 7z a '" + dfile + "' -r '" + sfile + "' > " + tmps + " 2>&1")
elif stype == 'tar_gz':
mw.execShell("cd '" + path + "' && tar -zcvf '" + dfile + "' " + sfile + " > " + tmps + " 2>&1")
elif stype == 'xz':
cmd = "cd '" + path + "' && tar -cvf '" + dfile + ".tar' " + sfile + " && xz -z '" + dfile + ".tar' " > " + tmps + " 2>&1"
mw.execShell(cmd)
elif stype == 'rar':
if not mw.checkBinExist('rar'):
return mw.returnData(False, 'rar压缩命令不存在请安装!')