🔬
Documentation
  • 👋Development Documentation
  • Overview
    • 💡What we do
    • ✨Our Features
  • Product Guides
    • 📪Making a post
    • 📎Understanding Projects
  • Fundamentals
    • 🛠️Getting set up
      • 📝Setting permissions
      • 🧑Inviting Members
  • Use Cases
    • 🎨For Designers
    • Page 1
    • 🖥️For Developers
      • Example of .gitignore
      • Cusotm Theme File Sync script for specified directories with auto git commit
    • ◀️List of Plugins
    • 👨‍💻Tips and Tricks
      • CLI schedule task and consume service
      • ♻️Automatic database backup (Updated)
      • 🛠️Execute a command from host to docker using terminal
      • 📋Shopware 6 commands
      • 😀Activate all plugins via CLI
      • ☠️Kill a process on a port [Linux]
      • 📄How do you import the database using CLI
      • 👨‍🔧Change PHP Configuration [Terminal]
      • 👁️Access to PHP Path Aixspro
      • 🌐Manage Apache services [Linux]
    • 📄SQL Tips & Tricks (shopware 6)
Powered by GitBook
On this page
  • Setup
  • Running the Script
  • Final Notes
  1. Use Cases
  2. For Developers

Cusotm Theme File Sync script for specified directories with auto git commit

Running the Battron-Voltimax Theme Sync Script to avoid repeatative manual change as some direcotory contains same file and changes

# Battron-Voltimax Theme Sync

The ultimate way to ensure changes from the Battron theme gracefully 
fly over to the Voltimax theme. Because, let's face it, manual copying 
is just not our style anymore!

## Introduction

This script, `battron_voltimax_themes_sync_repos.sh`, is designed to perform
a one-way sync of specific directories from the Battron theme to the Voltimax theme.
 With a touch of humor to keep things lively!

## The Script

```bash
#!/bin/bash

# Define the paths for both themes
BATTRON_THEME_PATH="/path/to/Battron/theme/directory"
VOLTIMAX_PATH="/path/to/Voltimax/theme/directory"

# Directories to be synchronized
directories=
("Resources/public" "Resources/snippet" "Resources/views/storefront" "Resources/form")

# Syncing the directories
for dir in "${directories[@]}"; do
    rsync -avh "${BATTRON_THEME_PATH}/${dir}/" "${VOLTIMAX_PATH}/${dir}/"
done

# Move to the Voltimax directory for git operations
cd "$VOLTIMAX_PATH"

# Git add, commit, and push
git add .
git commit -m "Auto-synced changes from Battron theme on $(date '+%Y-%m-%d %H:%M:%S')"
git push

echo "💾 Sync complete! Your changes now reside comfortably in the Voltimax theme. 
Time for a coffee break, perhaps?"

Setup

  1. Place the battron_voltimax_themes_sync_repos.sh in your preferred directory.

  2. Make sure the paths in the script correctly represent your Battron and Voltimax theme directories.

  3. Grant execute permissions to the script:

chmod +x /path/to/your/script/battron_voltimax_themes_sync_repos.sh

Running the Script

  1. Fire up your terminal. If you're feeling fancy, put on some epic background music.

  2. Head over to where your script is chilling:

cd /path/to/your/script_directory

  1. Summon the script:

./battron_voltimax_themes_sync_repos.sh
  1. Sit back, relax, and watch the terminal do its thing. Once done, it'll let you know with a quirky message!

Final Notes

  • It's crucial to double-check your directory paths.

  • Remember, this is a one-way sync; changes are copied from Battron to Voltimax, not the other way around.

  • Backup is always your friend. Sync responsibly!


Remember, with great power (automation!) comes... well, a bit more free time, actually. Enjoy that coffee break! ☕


Replace the `/path/to/Battron/theme/directory` and `/path/to/Voltimax/theme/directory` placeholders with your actual paths before using the script. When sharing, simply keep the placeholders to maintain privacy.
PreviousExample of .gitignoreNextList of Plugins

Last updated 6 months ago

🖥️