Files
clash-proxy/.husky/pre-commit
2025-06-09 13:48:38 +08:00

27 lines
529 B
Bash
Executable File

#!/bin/bash
#pnpm pretty-quick --staged
if git diff --cached --name-only | grep -q '^src/'; then
pnpm format:check
if [ $? -ne 0 ]; then
echo "Code format check failed in src/. Please fix formatting issues."
exit 1
fi
fi
if git diff --cached --name-only | grep -q '^src-tauri/'; then
cd src-tauri
cargo fmt
if [ $? -ne 0 ]; then
echo "rustfmt failed to format the code. Please fix the issues and try again."
exit 1
fi
cd ..
fi
#git add .
# 允许提交
exit 0