forked from WISE-Community/WISE-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit
More file actions
executable file
·19 lines (19 loc) · 765 Bytes
/
pre-commit
File metadata and controls
executable file
·19 lines (19 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
echo "*****************************"
echo "* BEGIN WISE PRECOMMIT HOOK *"
echo "*****************************"
if [ "`git diff --cached --name-status | grep src/main/webapp/site | wc -l`" -gt 0 ]; then
docker exec -it wise-client npm run extract-i18n
if [ "`git diff --name-status | awk '$1 == "M"' | grep xlf | wc -l`" -gt 0 ]; then
echo "Your code generated changes to the following file(s):"
git diff --name-status | awk '$1 == "M"' | grep xlf
git add src/messages.xlf
echo "Generated file(s) were added to git for commit"
echo "You can commit with -n to bypass this pre-commit hook."
echo "Done."
exit 0
fi
fi
echo "***************************"
echo "* END WISE PRECOMMIT HOOK *"
echo "***************************"