mirror of
https://github.com/LukeSmithxyz/based.cooking.git
synced 2025-03-14 13:55:53 +00:00
Added a check for file extension.
3 recipes recently have been submitted with missing file extensions, so now we can catch those easier.
This commit is contained in:
parent
4af79b651f
commit
97b828a82f
14
.github/workflows/scripts/check-files.sh
vendored
14
.github/workflows/scripts/check-files.sh
vendored
@ -61,6 +61,8 @@ check_recipe() {
|
||||
}
|
||||
|
||||
while IFS= read -r file; do
|
||||
errMsgs=''
|
||||
|
||||
# If the file doesn't exist, then the user probably deleted it, so don't
|
||||
# check it.
|
||||
# This will also ignore things that aren't files, like if someone adds a
|
||||
@ -77,6 +79,9 @@ while IFS= read -r file; do
|
||||
example.md) ;;
|
||||
README.md) ;;
|
||||
.github/*.md) ;;
|
||||
LICENSE) ;;
|
||||
Makefile) ;;
|
||||
config) ;;
|
||||
|
||||
*.webp)
|
||||
errMsgs="$(check_image "$file")"
|
||||
@ -84,6 +89,15 @@ while IFS= read -r file; do
|
||||
*.md)
|
||||
errMsgs="$(check_recipe "$file")"
|
||||
;;
|
||||
|
||||
*.*)
|
||||
# Catch any other file with an extension and don't do anything
|
||||
# special
|
||||
;;
|
||||
*)
|
||||
# Catch anything else (ie, any file without an extension)
|
||||
errMsgs="File doesn't have a file extension. If this is a recipe, add '.md' to the end of this filename.";
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$errMsgs" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user