chore(.husky/pre-commit): improve pre-commit hook run presentation

This commit is contained in:
Cory Dransfeldt 2025-06-14 20:39:25 -07:00
parent fdeec2c176
commit 2b22d10b46
No known key found for this signature in database
3 changed files with 33 additions and 5 deletions

View file

@ -1,2 +1,30 @@
npx lint-staged
npm run format:sql
#!/bin/sh
COLOR_YELLOW="\033[1;33m"
COLOR_GREEN="\033[1;32m"
COLOR_RED="\033[1;31m"
COLOR_RESET="\033[0m"
echo ""
echo "${COLOR_YELLOW}⏱️ Running formatters and linters...${COLOR_RESET}"
LINT_OUTPUT=$(npx lint-staged 2>&1)
if [ $? -ne 0 ]; then
echo "${COLOR_RED}❌ Lint-staged failed:${COLOR_RESET}"
echo "$LINT_OUTPUT"
exit 1
else
echo "${COLOR_GREEN}✅ Lint-staged passed.${COLOR_RESET}"
fi
SQL_OUTPUT=$(npm run format:sql --silent 2>&1)
if [ $? -ne 0 ]; then
echo "${COLOR_RED}❌ SQL formatting failed:${COLOR_RESET}"
echo "$SQL_OUTPUT"
exit 1
else
echo "${COLOR_GREEN}✅ SQL formatted successfully.${COLOR_RESET}"
fi
echo "${COLOR_GREEN}🎉 All pre-commit checks passed. Committing!${COLOR_RESET}"
echo ""

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "10.3.6",
"version": "10.4.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "10.3.6",
"version": "10.4.6",
"license": "MIT",
"dependencies": {
"minisearch": "^7.1.2",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "10.3.6",
"version": "10.4.6",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {