Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated the husky commands to accommodate GH
  • Loading branch information
krofax committed Mar 6, 2025
commit 29d1343798cfce7b034c3cec3c6d2765471f33c7
20 changes: 18 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo "🔍 Running automatic fixes before pushing..."
# Use npx to ensure pnpm is found, or use the full path
npx pnpm fix

# Try multiple ways to run pnpm
if command -v pnpm >/dev/null 2>&1; then
# Direct pnpm if available in PATH
pnpm fix
elif [ -f "$(npm root -g)/pnpm/bin/pnpm.cjs" ]; then
# Try global NPM installation path
"$(npm root -g)/pnpm/bin/pnpm.cjs" fix
elif command -v npx >/dev/null 2>&1; then
# Fallback to npx if available
npx --no-install pnpm fix
else
echo "⚠️ Could not find pnpm. Skipping automatic fixes..."
exit 0 # Don't fail the push, just continue
fi

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