diff options
Diffstat (limited to 'Biz/Ide/hooks/pre-commit')
-rwxr-xr-x | Biz/Ide/hooks/pre-commit | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Biz/Ide/hooks/pre-commit b/Biz/Ide/hooks/pre-commit new file mode 100755 index 0000000..507d7e6 --- /dev/null +++ b/Biz/Ide/hooks/pre-commit @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# - prevent frozen code from being checked in +# - guard against lint errors +## + set -e + changed=($(git diff-index --cached --name-only HEAD)) + for ns in ${changed[@]} + do + version=$($BIZ_ROOT/Biz/Ide/version $ns) + if (( $version < 1 )); then + echo "fail: version: $ns: $version" + exit 1 + else + echo "info: version: $ns: $version" + fi + done + $BIZ_ROOT/Biz/Ide/lint **/* +## |