#!/bin/bash # Define the customaddons directory relative to the script location CUSTOM_ADDONS_DIR="$(dirname "$0")/customaddons" if [ ! -d "$CUSTOM_ADDONS_DIR" ]; then echo "Error: customaddons directory not found at $CUSTOM_ADDONS_DIR" exit 1 fi echo "Starting git pull for all modules in $CUSTOM_ADDONS_DIR..." # Iterate over each subdirectory in customaddons for dir in "$CUSTOM_ADDONS_DIR"/*; do if [ -d "$dir" ]; then # Check if it's a git repository if [ -d "$dir/.git" ]; then echo "--------------------------------------------------" echo "Pulling updates for $(basename "$dir")..." (cd "$dir" && git pull) else # Optional: Uncomment the line below if you want to be notified about non-git folders # echo "Skipping $(basename "$dir") - Not a git repository" : fi fi done echo "--------------------------------------------------" echo "All done."