瀏覽代碼

ci: add bun version check to pre-push hook to ensure version consistency

Dax Raad 9 月之前
父節點
當前提交
776091cc23
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      .husky/pre-push

+ 7 - 0
.husky/pre-push

@@ -1,2 +1,9 @@
 #!/bin/sh
+# Check if bun version matches package.json
+EXPECTED_VERSION=$(grep '"packageManager"' package.json | sed 's/.*"bun@\([^"]*\)".*/\1/')
+CURRENT_VERSION=$(bun --version)
+if [ "$CURRENT_VERSION" != "$EXPECTED_VERSION" ]; then
+  echo "Error: Bun version $CURRENT_VERSION does not match expected version $EXPECTED_VERSION from package.json"
+  exit 1
+fi
 bun typecheck