diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 index c2353602..c6b70e4c --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,19 +1,14 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" +#!/bin/bash -# Define the unwanted lock files -unwanted_files=("package-lock.json" "pnpm-lock.yaml" "bun.lockb") - -# Check for unwanted lock files in the staged changes -for file in "${unwanted_files[@]}"; do - if git diff --cached --name-only | grep -qE "^$file$"; then - echo "Error: Commits containing '$file' are not allowed. Please use Yarn and remove this file from your commit." - exit 1 - fi -done - -# Allow only yarn.lock, not mandatory but should be the only lock file if present -if git diff --cached --name-only | grep -qE "^(package-lock\.json|pnpm-lock\.yaml|bun\.lockb)$"; then - echo "Error: Only 'yarn.lock' is allowed as a lock file. Please remove any other lock files from your commit." - exit 1 +# Check for unwanted lock files in staged changes +if git diff --cached --name-only | grep -E '^(package-lock\.json|pnpm-lock\.yaml|bun\.lockb)$' > /dev/null; then + echo "Error: Commits containing 'package-lock.json', 'pnpm-lock.yaml', or 'bun.lockb' are not allowed." + echo "Please use Yarn and remove these files from your commit." + exit 1 fi + +# Allow only yarn.lock (optional but exclusive) +if git diff --cached --name-only | grep -E '^(package-lock\.json|pnpm-lock\.yaml|bun\.lockb)$' > /dev/null; then + echo "Error: Only 'yarn.lock' is allowed as a lock file. Please remove other lock files." + exit 1 +fi \ No newline at end of file diff --git a/apps/web/components/Blog.tsx b/apps/web/components/Blog.tsx index c652923f..7f5191ce 100644 --- a/apps/web/components/Blog.tsx +++ b/apps/web/components/Blog.tsx @@ -51,7 +51,7 @@ export const Blog = ({