-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathupdate-lite.sh
More file actions
39 lines (29 loc) · 992 Bytes
/
update-lite.sh
File metadata and controls
39 lines (29 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Script to update the offline-documentation without images on gh-pages-lite branch
# Safety check: Make sure we're on main
if [ "$(git branch --show-current)" != "main" ]; then
echo "ERROR: This script must be run from the main branch."
echo "Currently on: $(git branch --show-current)"
exit 1
fi
# Check for uncommitted changes
if ! git diff-index --quiet HEAD --; then
echo "ERROR: You have uncommitted changes. Please commit or stash them first."
exit 1
fi
echo "Updating gh-pages-lite..."
# Fetch latest gh-pages
git fetch origin gh-pages
# Switch to gh-pages-lite
git checkout gh-pages-lite
# Reset to match gh-pages exactly
git reset --hard origin/gh-pages
# Remove images
rm -rf assets/images/ assets/examples/ assets/tutorials/ reference/assets/
# Commit and push
git add -A
git commit -m "Update lite version (remove images)"
git push --force origin gh-pages-lite
# Switch back to main
git checkout main
echo "Done! gh-pages-lite updated."