netdb: fix pre-commit, check shell scripts too
This commit is contained in:
parent
7330d87abd
commit
4ddf42f5c1
|
@ -1,10 +1,13 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
# only apply precommit validation script-checks when we have changes in FILE_DB
|
||||
FILE_DB='infrastructure/acer30/db/network.yml'
|
||||
if git diff --cached --name-only | grep "${FILE_DB}" > /dev/null; then
|
||||
# apply precommit validation script-checks for files that require validation
|
||||
|
||||
DB_DIR='infrastructure/acer30/db'
|
||||
FILE_DB="${DB_DIR}/network.yml"
|
||||
|
||||
if git diff --cached --name-only | grep -E "${FILE_DB}|${DB_DIR}/.*\.sh$" > /dev/null; then
|
||||
# git directory -> src https://stackoverflow.com/questions/7065224/in-a-git-hook-is-the-current-working-directory-guaranteed-to-be-within-the-git-r/37927943#37927943
|
||||
cd "${FILE_DB}"
|
||||
cd "${DB_DIR}"
|
||||
./validate_network.sh --file network.yml
|
||||
shellspec
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue