chore(git): skip hooks if runner isn't found

This commit is contained in:
khai96_
2026-03-03 00:57:14 +07:00
parent 4793a9380a
commit 2397cc0153
2 changed files with 28 additions and 2 deletions

View File

@@ -1 +1,14 @@
pnpm commitlint --edit --config=commitlint.config.cjs
#! /usr/bin/env sh
set -o errexit -o nounset
runner=$(
command -v pnpm ||
command -v npm ||
true
)
if [ -n "$runner" ]; then
exec "$runner" commitlint --edit --config=commitlint.config.cjs
else
echo 'Neither pnpm nor npm was found. Skip linting.' >&2
fi

View File

@@ -1 +1,14 @@
pnpm run lint --quiet
#! /usr/bin/env sh
set -o errexit -o nounset
runner=$(
command -v pnpm ||
command -v npm ||
true
)
if [ -n "$runner" ]; then
exec "$runner" run lint --quiet
else
echo 'Neither pnpm nor npm was found. Skip linting.' >&2
fi