Files
piratepoet/mailpoet/tasks/lint-staged-js.sh
John Oleksowicz fcc4be330c Add set -e to hook scripts to exit on fail
MAILPOET-4237
2024-02-08 11:13:35 -06:00

17 lines
324 B
Bash
Executable File

#!/bin/sh
set -e
source $PWD/.env
if [ "$MP_GIT_HOOKS_ENABLE" != "true" ]; then
echo "MP_GIT_HOOKS_ENABLE is not set to 'true', skipping lint-staged-js"
exit 0
fi
if [ "$MP_GIT_HOOKS_ESLINT" = "true" ]; then
eslint --max-warnings 0 $@
else
echo "MP_GIT_HOOKS_ESLINT is not set to 'true', skipping eslint"
fi