|
| 1 | +#!/bin/bash |
| 2 | +# Script to manually sync wiki documentation |
| 3 | +# Usage: ./scripts/sync-wiki.sh |
| 4 | + |
| 5 | +set -e # Exit on error |
| 6 | + |
| 7 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 8 | +PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" |
| 9 | +WIKI_REPO="$PROJECT_ROOT/cosmic-ui-lite.wiki" |
| 10 | + |
| 11 | +echo "🔄 Starting wiki sync..." |
| 12 | + |
| 13 | +# Check if docs/wiki directory exists |
| 14 | +if [ ! -d "$PROJECT_ROOT/docs/wiki" ]; then |
| 15 | + echo "❌ Error: docs/wiki directory not found" |
| 16 | + exit 1 |
| 17 | +fi |
| 18 | + |
| 19 | +# Clone or update wiki repository |
| 20 | +if [ -d "$WIKI_REPO" ]; then |
| 21 | + echo "📦 Updating existing wiki repository..." |
| 22 | + cd "$WIKI_REPO" |
| 23 | + git pull origin master |
| 24 | +else |
| 25 | + echo "📦 Cloning wiki repository..." |
| 26 | + cd "$PROJECT_ROOT" |
| 27 | + git clone https://github.com/fuR-Gaming/cosmic-ui-lite.wiki.git |
| 28 | +fi |
| 29 | + |
| 30 | +# Copy documentation files |
| 31 | +echo "📝 Copying documentation files..." |
| 32 | +cp "$PROJECT_ROOT/docs/wiki/wiki-home.md" "$WIKI_REPO/Home.md" |
| 33 | +cp "$PROJECT_ROOT/docs/wiki/wiki-installation-setup.md" "$WIKI_REPO/Installation-&-Setup.md" |
| 34 | +cp "$PROJECT_ROOT/docs/wiki/wiki-component-reference.md" "$WIKI_REPO/Component-Reference.md" |
| 35 | +cp "$PROJECT_ROOT/docs/wiki/wiki-complete-examples.md" "$WIKI_REPO/Complete-Examples.md" |
| 36 | +cp "$PROJECT_ROOT/docs/wiki/wiki-troubleshooting.md" "$WIKI_REPO/Troubleshooting.md" |
| 37 | +cp "$PROJECT_ROOT/docs/wiki/wiki-architecture-overview.md" "$WIKI_REPO/Architecture-Overview.md" |
| 38 | + |
| 39 | +# Check for changes |
| 40 | +cd "$WIKI_REPO" |
| 41 | +if [ -z "$(git status --porcelain)" ]; then |
| 42 | + echo "✅ No changes to sync" |
| 43 | + exit 0 |
| 44 | +fi |
| 45 | + |
| 46 | +# Show changes |
| 47 | +echo "📊 Changes detected:" |
| 48 | +git status --short |
| 49 | + |
| 50 | +# Commit and push |
| 51 | +echo "💾 Committing changes..." |
| 52 | +git add . |
| 53 | + |
| 54 | +# Get the latest commit message from main repo for context |
| 55 | +LATEST_COMMIT=$(cd "$PROJECT_ROOT" && git log -1 --pretty=format:"%s") |
| 56 | + |
| 57 | +git commit -m "Sync wiki documentation |
| 58 | +
|
| 59 | +Latest main repo commit: $LATEST_COMMIT |
| 60 | +
|
| 61 | +🔄 Manual sync via script" |
| 62 | + |
| 63 | +echo "🚀 Pushing to GitHub..." |
| 64 | +git push origin master |
| 65 | + |
| 66 | +echo "✅ Wiki documentation synced successfully!" |
| 67 | +echo "📚 View at: https://github.com/fuR-Gaming/cosmic-ui-lite/wiki" |
0 commit comments