2023-09-17 01:58:55 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script is used to check if the style.css file is up to date.
|
|
|
|
|
|
|
|
# Check if the git tree for CWD is clean
|
2023-10-10 00:02:05 +08:00
|
|
|
if [ -n "$(git status internal/view/assets/css --porcelain)" ]; then
|
2023-09-17 01:58:55 +08:00
|
|
|
echo "❌ git tree is not clean. Please commit all changes before running this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-11-05 18:02:31 +08:00
|
|
|
# Check if prettier is ok
|
|
|
|
if ! bun x prettier internal/view/ --check; then
|
|
|
|
echo "❌ code style issues found. Please run 'make styles' and commit the changes."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-09-17 01:58:55 +08:00
|
|
|
# Check style.css file
|
|
|
|
CLEANCSS_OPTS=${CLEANCSS_OPTS} make styles
|
2023-10-10 00:02:05 +08:00
|
|
|
if [ -n "$(git status internal/view/assets/css --porcelain)" ]; then
|
2023-09-17 01:58:55 +08:00
|
|
|
echo "❌ style.css wasn't built from less changes. Please run 'make styles' and commit the changes."
|
2023-10-10 00:02:05 +08:00
|
|
|
git checkout -- internal/view/assets/css/
|
2023-09-17 01:58:55 +08:00
|
|
|
exit 1
|
|
|
|
fi
|