Skip to content

Commit 95afdd5

Browse files
committed
update update-lite.sh
1 parent 72400d6 commit 95afdd5

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

update-lite.sh

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
11
#!/bin/bash
2+
# Script to update the offline-documentation without images on gh-pages-lite branch
23

3-
# This script updates the offline documentation without images, for downloading
4-
# URL for the downloadable zip is linked at https://l5lua.org/download/#offline-documentation
4+
# Safety check: Make sure we're on main
5+
if [ "$(git branch --show-current)" != "main" ]; then
6+
echo "ERROR: This script must be run from the main branch."
7+
echo "Currently on: $(git branch --show-current)"
8+
exit 1
9+
fi
10+
11+
# Check for uncommitted changes
12+
if ! git diff-index --quiet HEAD --; then
13+
echo "ERROR: You have uncommitted changes. Please commit or stash them first."
14+
exit 1
15+
fi
516

617
echo "Updating gh-pages-lite..."
18+
19+
# Fetch latest gh-pages
720
git fetch origin gh-pages
21+
22+
# Switch to gh-pages-lite
823
git checkout gh-pages-lite
9-
git merge origin/gh-pages
24+
25+
# Reset to match gh-pages exactly
26+
git reset --hard origin/gh-pages
27+
28+
# Remove images
1029
rm -rf assets/images/ assets/examples/ assets/tutorials/ reference/assets/
30+
31+
# Commit and push
1132
git add -A
1233
git commit -m "Update lite version (remove images)"
13-
git push origin gh-pages-lite
34+
git push --force origin gh-pages-lite
35+
36+
# Switch back to main
1437
git checkout main
38+
1539
echo "Done! gh-pages-lite updated."

0 commit comments

Comments
 (0)