Skip to content

Commit 29d1343

Browse files
committed
updated the husky commands to accommodate GH
1 parent dbd4b91 commit 29d1343

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.husky/pre-push

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
14
echo "🔍 Running automatic fixes before pushing..."
2-
# Use npx to ensure pnpm is found, or use the full path
3-
npx pnpm fix
5+
6+
# Try multiple ways to run pnpm
7+
if command -v pnpm >/dev/null 2>&1; then
8+
# Direct pnpm if available in PATH
9+
pnpm fix
10+
elif [ -f "$(npm root -g)/pnpm/bin/pnpm.cjs" ]; then
11+
# Try global NPM installation path
12+
"$(npm root -g)/pnpm/bin/pnpm.cjs" fix
13+
elif command -v npx >/dev/null 2>&1; then
14+
# Fallback to npx if available
15+
npx --no-install pnpm fix
16+
else
17+
echo "⚠️ Could not find pnpm. Skipping automatic fixes..."
18+
exit 0 # Don't fail the push, just continue
19+
fi
420

521
# Check if there are any changes after running fixes
622
if [ -n "$(git status --porcelain)" ]; then

0 commit comments

Comments
 (0)