fix: streamline pre-push hook to run clippy only for src-tauri changes
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# 运行 clippy
|
if git diff --cached --name-only | grep -q '^src-tauri/'; then
|
||||||
# cargo clippy --manifest-path ./src-tauri/Cargo.toml --fix
|
cargo clippy --manifest-path ./src-tauri/Cargo.toml
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Clippy found issues in src-tauri. Please fix them before pushing."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# 如果 clippy 失败,阻止 push
|
|
||||||
# if [ $? -ne 0 ]; then
|
|
||||||
# echo "Clippy found issues in sub_crate. Please fix them before pushing."
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# 允许 push
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user