Simplify client fork workflow to colors only
- Created templates/gitignore-template for client forks - Updated scripts/create-client-fork.sh to only handle colors - Updated .github/workflows/create-client-fork.yml to match simplified workflow - Updated docs/CLIENT_FORK_WORKFLOW.md with colors-only approach - Updated templates/README.md to remove custom code fork references - Client forks now only track custom color files, not README or custom code Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
@@ -3,11 +3,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Script: Create Client Fork Setup
|
||||
# Script: Create Client Fork Setup (Colors Only)
|
||||
# This script prepares the repository for a client-specific fork by:
|
||||
# - Copying custom color templates to the appropriate locations
|
||||
# - Replacing the main README with the client fork README
|
||||
# - Cleaning up template documentation files
|
||||
# - Setting up .gitignore to track colors_custom.css files in the fork
|
||||
|
||||
set -e
|
||||
|
||||
@@ -37,11 +36,12 @@ BRANCH_NAME="client-fork/${CLIENT_SLUG}"
|
||||
|
||||
echo ""
|
||||
echo "╔════════════════════════════════════════════════════════════════╗"
|
||||
echo "║ MokoCassiopeia - Client Fork Setup Script ║"
|
||||
echo "║ MokoCassiopeia - Client Fork Setup (Colors Only) ║"
|
||||
echo "╚════════════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
print_info "Client Name: ${CLIENT_NAME}"
|
||||
print_info "Branch Name: ${BRANCH_NAME}"
|
||||
print_info "Scope: Custom colors only"
|
||||
echo ""
|
||||
|
||||
# Confirm before proceeding
|
||||
@@ -53,8 +53,13 @@ if [[ ! $REPLY =~ ^[Yy]es$ ]]; then
|
||||
fi
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [ ! -f "CLIENT_FORK_README.md" ]; then
|
||||
print_error "CLIENT_FORK_README.md not found. Are you in the repository root?"
|
||||
if [ ! -f "templates/colors_custom.css" ]; then
|
||||
print_error "templates/colors_custom.css not found. Are you in the repository root?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "templates/gitignore-template" ]; then
|
||||
print_error "templates/gitignore-template not found. Are you in the repository root?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -65,6 +70,8 @@ print_success "Branch created"
|
||||
|
||||
# Copy custom color templates
|
||||
print_info "Copying colors_custom.css to light and dark mode directories..."
|
||||
mkdir -p src/media/css/colors/light
|
||||
mkdir -p src/media/css/colors/dark
|
||||
cp templates/colors_custom.css src/media/css/colors/light/colors_custom.css
|
||||
cp templates/colors_custom.css src/media/css/colors/dark/colors_custom.css
|
||||
|
||||
@@ -76,46 +83,11 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Replace README with client fork README
|
||||
print_info "Replacing README.md with CLIENT_FORK_README.md..."
|
||||
sed "s/\[CLIENT NAME\]/${CLIENT_NAME}/g" CLIENT_FORK_README.md > README.md.new
|
||||
mv README.md.new README.md
|
||||
|
||||
# Update fork information section
|
||||
CURRENT_DATE=$(date +"%Y-%m-%d")
|
||||
sed -i.bak "s/\[DATE\]/${CURRENT_DATE}/g" README.md
|
||||
sed -i.bak "s/\[YOUR-FORK-URL\]/[UPDATE-WITH-YOUR-FORK-URL]/g" README.md
|
||||
rm -f README.md.bak
|
||||
|
||||
print_success "README.md replaced with customized client fork README"
|
||||
|
||||
# Clean up template files
|
||||
print_info "Removing template documentation files..."
|
||||
|
||||
if [ -f "CLIENT_FORK_README.md" ]; then
|
||||
rm CLIENT_FORK_README.md
|
||||
print_success "Removed CLIENT_FORK_README.md"
|
||||
fi
|
||||
|
||||
if [ -f "templates/CLIENT_FORK_README_TEMPLATE.md" ]; then
|
||||
rm templates/CLIENT_FORK_README_TEMPLATE.md
|
||||
print_success "Removed templates/CLIENT_FORK_README_TEMPLATE.md"
|
||||
fi
|
||||
|
||||
# Update templates/README.md
|
||||
if [ -f "templates/README.md" ]; then
|
||||
# Create a backup
|
||||
cp templates/README.md templates/README.md.bak
|
||||
|
||||
# Remove references to CLIENT_FORK_README_TEMPLATE.md
|
||||
sed '/CLIENT_FORK_README_TEMPLATE.md/d' templates/README.md > templates/README.md.tmp
|
||||
mv templates/README.md.tmp templates/README.md
|
||||
rm -f templates/README.md.bak
|
||||
|
||||
print_success "Updated templates/README.md"
|
||||
fi
|
||||
|
||||
print_success "Keeping templates/colors_custom.css as template"
|
||||
# Copy template .gitignore to root
|
||||
print_info "Setting up .gitignore to track custom color files..."
|
||||
cp templates/gitignore-template .gitignore
|
||||
print_success "Copied templates/gitignore-template to .gitignore"
|
||||
print_info "Custom color files will be tracked in this fork"
|
||||
|
||||
# Show git status
|
||||
echo ""
|
||||
@@ -128,14 +100,13 @@ read -p "Commit these changes? (yes/no): " -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]es$ ]]; then
|
||||
git add .
|
||||
git commit -m "Setup client fork for ${CLIENT_NAME}
|
||||
git commit -m "Setup client fork for ${CLIENT_NAME} (colors only)
|
||||
|
||||
- Copied colors_custom.css to src/media/css/colors/light/ and dark/
|
||||
- Replaced README.md with customized CLIENT_FORK_README.md
|
||||
- Removed CLIENT_FORK_README.md and templates/CLIENT_FORK_README_TEMPLATE.md
|
||||
- Kept templates/colors_custom.css as template
|
||||
- Applied client fork .gitignore template to track custom color files
|
||||
- Kept templates/colors_custom.css as reference template
|
||||
|
||||
This commit prepares the repository for ${CLIENT_NAME}'s custom fork."
|
||||
This commit prepares the repository for ${CLIENT_NAME}'s custom colors."
|
||||
|
||||
print_success "Changes committed successfully"
|
||||
|
||||
@@ -153,16 +124,16 @@ echo ""
|
||||
echo "Changes Applied:"
|
||||
print_success "Copied colors_custom.css to src/media/css/colors/light/"
|
||||
print_success "Copied colors_custom.css to src/media/css/colors/dark/"
|
||||
print_success "Replaced README.md with customized client fork README"
|
||||
print_success "Removed CLIENT_FORK_README.md"
|
||||
print_success "Removed templates/CLIENT_FORK_README_TEMPLATE.md"
|
||||
print_success "Kept templates/colors_custom.css as template"
|
||||
print_success "Applied client fork .gitignore template"
|
||||
print_success "Custom color files will be tracked in this fork"
|
||||
echo ""
|
||||
echo "Next Steps:"
|
||||
echo "1. Review the changes in branch: ${BRANCH_NAME}"
|
||||
echo "2. Customize colors in src/media/css/colors/light/colors_custom.css"
|
||||
echo "3. Customize colors in src/media/css/colors/dark/colors_custom.css"
|
||||
echo "4. Update README.md with client-specific details"
|
||||
echo "4. Test the colors in both light and dark modes"
|
||||
echo "5. Create a new repository for ${CLIENT_NAME}"
|
||||
echo "6. Push this branch to the new repository"
|
||||
echo "7. In Joomla: System → Site Templates → MokoCassiopeia → Theme tab"
|
||||
echo "8. Set palette to 'Custom' and save"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user