我正在尝试使用Fastlane将Slather创建的代码覆盖率报告发送给Codacy。这是车道:
desc "Do A Slather and send to Codacy"
lane :code_coverage do |options|
slather(output_directory: "SlatherReports", scheme: "MyApp", configuration: "Debug", workspace: "MyApp.xcworkspace", proj: "MyApp.xcodeproj", cobertura_xml: true, use_bundle_exec: true)
ENV["CODACY_PROJECT_TOKEN"] = options[:codacy_token]
sh "bash <(curl -Ls https://coverage.codacy.com/get.sh -r SlatherReports/cobertura.xml)"
end
Slather有效,但bash脚本无效。它返回此错误:
[[06:40:19]:命令'bash的退出状态https://coverage.codacy.com/get.sh-r SlatherReports / cobertura.xml)'是2而不是0。sh:-c:第0行:意外令牌附近的语法错误`('sh:-c:第0行:bashhttps://coverage.codacy.com/get.sh-r SlatherReports / cobertura.xml)'
所以,我该如何解决?谢谢。
我自己找到了答案。这是一个非常简单的(为什么我以前没想到呢?)。我只是将整个bash <(curl -Ls https://coverage.codacy.com/get.sh -r SlatherReports/cobertura.xml)
行放入另一个bash脚本文件中,而是调用它。大声笑。