使用 Jenkins 调用 WinRAR.exe 进行压缩时,可能会遇到错误 'ERROR: Unknown option: afzipsending incremental file list'。这个错误通常是由于 WinRAR 命令行参数使用错误导致的。

错误原因:

  • 参数错误: WinRAR 命令行参数 -afzip 应该为 -afzipx,并且应该放在其他参数之前。
  • 路径错误: 缺少要压缩的文件或文件夹的路径。

正确代码:

set rarname=myfile.zip
set releaseVersionN=/path/to/releaseVersionN
set cwrsyncN=/path/to/cwrsyncN
set innerAddrN=myserver.com
set innerpackageFolderN=packages

WinRAR.exe a -afzipx '%rarname%' '%releaseVersionN%' -r %cwrsyncN% -rtpDlv --bwlimit=60000 './%rarname%' '%innerAddrN%::%innerpackageFolderN%/platform/branch/region'

代码解释:

  • rarname: 压缩文件名称,例如 myfile.zip
  • releaseVersionN: 版本路径,例如 /path/to/releaseVersionN
  • cwrsyncN: 同步路径,例如 /path/to/cwrsyncN
  • innerAddrN: 服务器地址,例如 myserver.com
  • innerpackageFolderN: 包文件夹名称,例如 packages
  • platform, branch, region: 分别代表平台、分支和区域。

请根据实际情况修改文件和文件夹的路径,以及服务器地址和文件夹名称。

WinRAR 命令行压缩错误:'ERROR: Unknown option: afzipsending incremental file list' 解决方法

原文地址: http://www.cveoy.top/t/topic/lMwe 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录