mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-07 13:35:22 +08:00
fix: styles-check and swag-check monitor just needed directory not project root (#747)
* styles-check just work on less and css directory * just cheack css directory * make swag-check just monitor generated files
This commit is contained in:
parent
2c31048634
commit
c6aabc49f1
2 changed files with 8 additions and 8 deletions
|
@ -3,15 +3,15 @@
|
|||
# This script is used to check if the style.css file is up to date.
|
||||
|
||||
# Check if the git tree for CWD is clean
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
if [ -n "$(git status internal/view/assets/css --porcelain)" ]; then
|
||||
echo "❌ git tree is not clean. Please commit all changes before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check style.css file
|
||||
CLEANCSS_OPTS=${CLEANCSS_OPTS} make styles
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
if [ -n "$(git status internal/view/assets/css --porcelain)" ]; then
|
||||
echo "❌ style.css wasn't built from less changes. Please run 'make styles' and commit the changes."
|
||||
git reset --hard
|
||||
git checkout -- internal/view/assets/css/
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -10,7 +10,7 @@ if [ "$CURRENT_SWAG_VERSION" != "$REQUIRED_SWAG_VERSION" ]; then
|
|||
fi
|
||||
|
||||
# Check if the git tree for CWD is clean
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
if [ -n "$(git status docs/swagger --porcelain)" ]; then
|
||||
echo "❌ git tree is not clean. Please commit all changes before running this script."
|
||||
git diff
|
||||
exit 1
|
||||
|
@ -18,18 +18,18 @@ fi
|
|||
|
||||
# Check swag comments
|
||||
make swag-fmt
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
if [ -n "$(git status docs/swagger --porcelain)" ]; then
|
||||
echo "❌ swag comments are not formatted. Please run 'make swag-fmt' and commit the changes."
|
||||
git diff
|
||||
git reset --hard
|
||||
git checkout -- docs/swagger
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check swagger documentation
|
||||
make swagger
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
if [ -n "$(git status docs/swagger --porcelain)" ]; then
|
||||
echo "❌ swagger documentation not updated, please run 'make swagger' and commit the changes."
|
||||
git diff
|
||||
git reset --hard
|
||||
git checkout -- docs/swagger
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue