mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
* fix: auto light-weight mode does not take effect when silent-start mode is enabled * refactor: streamline window state retrieval and hiding logic * fix: add checks for remote name and existence before format check in pre-push hook * fix: simplify remote checks in pre-push hook to enhance clarity and maintainability --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
26 lines
772 B
Bash
26 lines
772 B
Bash
#!/bin/bash
|
|
|
|
if git diff --cached --name-only | grep -q '^src-tauri/'; then
|
|
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
|
|
|
|
# 检查所有 remote url 是否有目标仓库
|
|
if git remote -v | grep -Eq 'github\\.com[:/]+clash-verge-rev/clash-verge-rev(\\.git)?'; then
|
|
echo "[pre-push] Detected push to clash-verge-rev/clash-verge-rev"
|
|
echo "[pre-push] Running pnpm format:check..."
|
|
|
|
pnpm format:check
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Code format check failed. Please fix formatting before pushing."
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "[pre-push] Not pushing to target repo. Skipping format check."
|
|
fi
|
|
|
|
exit 0
|