【问题标题】:Sending Codacy code coverage with Fastlane使用 Fastlane 发送 Codacy 代码覆盖率
【发布时间】:2020-04-05 23:56:09
【问题描述】:

我正在尝试使用 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: line 0: `bash https://coverage.codacy.com/get.sh -r SlatherReports/cobertura.xml)'

那么,我该如何解决这个问题?谢谢。

【问题讨论】:

    标签: ios bash fastlane codacy


    【解决方案1】:

    我自己找到了答案。这是一个非常简单的(为什么我没有早点想到这个?)。我只是将整个 bash &lt;(curl -Ls https://coverage.codacy.com/get.sh -r SlatherReports/cobertura.xml) 行放入不同的 bash 脚本文件并调用它。哈哈。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-30
      • 2016-01-12
      • 1970-01-01
      • 2018-01-11
      • 1970-01-01
      • 2017-01-25
      • 2016-11-29
      相关资源
      最近更新 更多