Add README checker
This commit is contained in:
parent
68c2515b5a
commit
7f4c294758
1 changed files with 21 additions and 0 deletions
21
hooks/pre-commit.d/check-readme.sh
Executable file
21
hooks/pre-commit.d/check-readme.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
description() {
|
||||||
|
echo "Checks for README.md file with the proper extension."
|
||||||
|
}
|
||||||
|
|
||||||
|
config() {
|
||||||
|
echo "README_BYPASS_EXT:bypasses extension check"
|
||||||
|
echo "README_BYPASS_ENO:bypasses execution halt when the README file is missing"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -e README ]]; then
|
||||||
|
pinfo "README file found instead of README.md. Consider changing the extension..."
|
||||||
|
[[ -z $README_BYPASS_EXT ]] && exit 1
|
||||||
|
else
|
||||||
|
if [[ -e README.md ]]; then
|
||||||
|
pinfo "README.md file found."
|
||||||
|
else
|
||||||
|
pwarn "No README file found..."
|
||||||
|
[[ -z $README_BYPASS_ENO ]] && exit 2
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in a new issue