summaryrefslogtreecommitdiff
path: root/.github/workflows/scripts/check-size.sh
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/scripts/check-size.sh')
-rwxr-xr-x.github/workflows/scripts/check-size.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/.github/workflows/scripts/check-size.sh b/.github/workflows/scripts/check-size.sh
index 15027bd..e6efd06 100755
--- a/.github/workflows/scripts/check-size.sh
+++ b/.github/workflows/scripts/check-size.sh
@@ -11,15 +11,24 @@ check_size() {
fi
}
+check_md_name() {
+ shouldname="$(echo "$1" |
+ iconv --to-code=utf-8 |
+ sed "s/^\(src\/\)\?/src\//" |
+ tr '[:upper:]' '[:lower:]' |
+ tr ' ' '-')"
+ if [ "$shouldname" != "$1" ]; then
+ echo "$1 should be named $shouldname."
+ exit 1
+ fi
+}
+
git diff --name-only `git merge-base origin/master HEAD` | while IFS= read -r file; do
case "$file" in
*.webp)
echo "Checking size of $file"
check_size $file
;;
- *)
- echo "Skipping $file"
- ;;
+ *.md) check_md_name "$file" ;;
esac
done
-