【发布时间】:2020-07-25 02:36:26
【问题描述】:
目录1:[anyName]-test/target/surefire-reports/*.xml
目录2:target/surefire-reports/*.xml
jenkins shell cmd 我想出了:
sh "jar -cMvf Test.zip target/surefire-reports/*.xml *-test/target/surefire-reports/*.xml "
只有一个目录存在(dir1 或 dir2),所以 shell 步骤总是因为没有文件或目录而失败。
有没有更好的办法在单个命令中查找 xml 文件而不会失败? (可能是一些正则表达式)谢谢!
【问题讨论】:
-
将我的问题编辑得更清楚。