Files
mattermost-mobile/scripts/pre-commit.sh
Elisabeth Kulzer 4bcb595e5b Add check for empty translation strings. (#4718)
* Add check for empty translation strings.

* Test

* Update mmjstools

* Resolve conflicts

* Revert translation test.

* Also use fake dir

* Also use fake dir

* Add translation checks to precommit hook. Remove from Makefile. Add to circleci.

* Fix script to keep it consistent.

* Keep consistent
2020-08-29 19:14:17 +02:00

33 lines
664 B
Bash
Executable File

#!/bin/sh
jsfiles=$(git diff --cached --name-only --diff-filter=ACM | grep -E '.js$|.ts$')
if [ -z "jsfiles" ]; then
exit 0
fi
if [ -n "$jsfiles" ]; then
echo "Checking lint for:"
for js in $jsfiles; do
echo "$js"
e=$(node_modules/.bin/eslint --quiet --fix $js)
if [ -n "$e" ]; then
echo "ERROR: Check eslint hints."
echo "$e"
exit 1 # reject
fi
done
echo "Checking for TSC"
tsc=$(node_modules/.bin/tsc --noEmit)
if [ -n "$tsc" ]; then
echo "ERROR: Check TSC hints."
echo "$tsc"
exit 1 # reject
fi
fi
scripts/precommit/i18n.sh
exit 0