瀏覽代碼

Ensure cross-platform of coverage.sh (#5316)

Voronor 7 月之前
父節點
當前提交
506e1f827a
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      scripts/checks/coverage.sh

+ 5 - 1
scripts/checks/coverage.sh

@@ -14,7 +14,11 @@ if [ "${CI:-"false"}" == "true" ]; then
   # Foundry coverage
   forge coverage --report lcov --ir-minimum
   # Remove zero hits
-  sed -i '/,0/d' lcov.info
+  if [[ "$OSTYPE" == "darwin"* ]]; then
+    sed -i '' '/,0/d' lcov.info
+  else
+    sed -i '/,0/d' lcov.info
+  fi
 fi
 
 # Reports are then uploaded to Codecov automatically by workflow, and merged.