feat: enhance pre-push hook to include remote URL check and improve format check messaging

This commit is contained in:
Tunglies
2025-06-18 18:49:48 +08:00
parent f3ad6cee41
commit 357b64e9a0
3 changed files with 25 additions and 7 deletions

View File

@@ -8,12 +8,20 @@ if git diff --cached --name-only | grep -q '^src-tauri/'; then
fi fi
fi fi
if [[ "$(git rev-parse --show-toplevel)" == */clash-verge-rev/clash-verge-rev ]]; then remote_name="$1"
remote_url=$(git remote get-url "$remote_name")
if [[ "$remote_url" =~ github\.com[:/]+clash-verge-rev/clash-verge-rev(\.git)?$ ]]; then
echo "[pre-push] Detected push to clash-verge-rev/clash-verge-rev ($remote_url)"
echo "[pre-push] Running pnpm format:check..."
pnpm format:check pnpm format:check
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Code format check failed. Please fix formatting before pushing." echo "Code format check failed. Please fix formatting before pushing."
exit 1 exit 1
fi fi
else
echo "[pre-push] Not pushing to target repo. Skipping format check."
fi fi
exit 0 exit 0

View File

@@ -165,7 +165,8 @@ export const useCustomTheme = () => {
const rootEle = document.documentElement; const rootEle = document.documentElement;
if (rootEle) { if (rootEle) {
const backgroundColor = mode === "light" ? "#ECECEC" : dt.background_color; const backgroundColor =
mode === "light" ? "#ECECEC" : dt.background_color;
const selectColor = mode === "light" ? "#f5f5f5" : "#3E3E3E"; const selectColor = mode === "light" ? "#f5f5f5" : "#3E3E3E";
const scrollColor = mode === "light" ? "#90939980" : "#555555"; const scrollColor = mode === "light" ? "#90939980" : "#555555";
const dividerColor = const dividerColor =
@@ -184,9 +185,18 @@ export const useCustomTheme = () => {
alpha(muiTheme.palette.primary.main, 0.1), alpha(muiTheme.palette.primary.main, 0.1),
); );
// 添加CSS变量 // 添加CSS变量
rootEle.style.setProperty("--window-border-color", mode === "light" ? "#cccccc" : "#1E1E1E"); rootEle.style.setProperty(
rootEle.style.setProperty("--scrollbar-bg", mode === "light" ? "#f1f1f1" : "#2E303D"); "--window-border-color",
rootEle.style.setProperty("--scrollbar-thumb", mode === "light" ? "#c1c1c1" : "#555555"); mode === "light" ? "#cccccc" : "#1E1E1E",
);
rootEle.style.setProperty(
"--scrollbar-bg",
mode === "light" ? "#f1f1f1" : "#2E303D",
);
rootEle.style.setProperty(
"--scrollbar-thumb",
mode === "light" ? "#c1c1c1" : "#555555",
);
} }
let styleElement = document.querySelector("style#verge-theme"); let styleElement = document.querySelector("style#verge-theme");

View File

@@ -502,7 +502,7 @@ const Layout = () => {
className={`${OS} layout`} className={`${OS} layout`}
style={{ style={{
borderTopLeftRadius: "0px", borderTopLeftRadius: "0px",
borderTopRightRadius: "0px" borderTopRightRadius: "0px",
}} }}
onContextMenu={(e) => { onContextMenu={(e) => {
if ( if (