0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/.husky/pre-commit
Michael Matloka 2fbf8088d2
chore(insights): Clean up insight details (#16322)
* chore(insights): Clean up insight details

* Fix pre-commit performance

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-04 19:59:31 +02:00

17 lines
509 B
Bash
Executable File

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Check if staged files contain any added or modified PNGs - skip when merging
if \
git rev-parse -q --verify MERGE_HEAD \
&& git diff --cached --name-status | grep '^[AM]' | grep -q '.png$'
then
# Error if OptiPNG is not installed
if ! command -v optipng >/dev/null; then
echo "PNG files must be optimized before being committed, but OptiPNG is not installed! Fix this with \`brew/apt install optipng\`."
exit 1
fi
fi
pnpm lint-staged