2025-03-13 12:51:20 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2025-03-16 14:34:29 +08:00
|
|
|
#pnpm pretty-quick --staged
|
2025-03-13 12:51:20 +08:00
|
|
|
|
2025-06-06 21:11:14 +08:00
|
|
|
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
|
2025-03-13 12:51:20 +08:00
|
|
|
|
2025-06-06 21:11:14 +08:00
|
|
|
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 ..
|
2025-03-26 18:59:31 +08:00
|
|
|
fi
|
2025-03-13 12:51:20 +08:00
|
|
|
|
2025-06-09 13:47:38 +08:00
|
|
|
#git add .
|
2025-03-13 12:51:20 +08:00
|
|
|
|
|
|
|
|
# 允许提交
|
|
|
|
|
exit 0
|