From afbd6a842225f932352c037e80e8ef366155dd11 Mon Sep 17 00:00:00 2001 From: cyrus28214 Date: Mon, 8 Sep 2025 14:07:45 +0800 Subject: [PATCH] chore: pre-commit script detect package manager --- .husky/pre-commit | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index d0a7784..c1fbc2b 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,9 @@ -npx lint-staged \ No newline at end of file +#!/bin/bash + +if [ -f "yarn.lock" ]; then + yarn lint-staged +elif [ -f "pnpm-lock.yaml" ]; then + pnpm lint-staged +else + npx lint-staged +fi \ No newline at end of file