1
我有一個.bat文件,這些行由Jenkins CI工作執行。它應該除去兩個匹配的IF條件之外的指定目錄中的所有子目錄。FOR/D終止失敗(此時意外...
SET EXPORT_ROOT=C:\WWW\LocalUser\myfolder
SET EXPORT_BUILD_ROOT=%EXPORT_ROOT%\build
SET EXPORT_BUILD_PATH=%EXPORT_BUILD_ROOT%\26
SET LAST_EXPORT_BUILD_PATH=C:\WWW\LocalUser\myfolder\build\25
cd %EXPORT_BUILD_ROOT%
FOR /D %G IN (*) DO (
IF NOT ("%EXPORT_BUILD_ROOT%\%G" == "%LAST_EXPORT_BUILD_PATH%") IF NOT ("%EXPORT_BUILD_ROOT%\%G" == "%EXPORT_BUILD_PATH%") (
rd /s /q "%G"
)
)
cd "%DEPLOY_DIR%"
在詹金斯CI記錄一個參見:
C:\WWW\LocalUser\myfolder\deploy>cd C:\WWW\LocalUser\myfolder\build
G" == "C:\WWW\LocalUser\myfolder\build\57") IF NOT ("EXPORT_BUILD_PATHG")) was unexpected at this time.
C:\WWW\LocalUser\myfolder\build>FOR /D G" == "C:\WWW\LocalUser\myfolder\build\57") IF NOT ("EXPORT_BUILD_PATHG"))
生成步驟 '執行Windows批處理命令' 標記構建爲失敗
謝謝,它的工作! – miloshavlicek