#!/bin/bash ################################################################################ # Script: standardize-build-script-naming.sh # Description: Standardizes all build script names from dot notation (.1g1r.sh) # to hyphen notation (-1g1r.sh) to ensure consistency across the # entire ROM groomer build system. # # Usage: ./standardize-build-script-naming.sh ################################################################################ cd /data/emu/rom-groomer echo "=== BUILD SCRIPT NAMING STANDARDIZATION ===" echo "Converting from: build-SYSTEM-VARIANT.1g1r.sh" echo " to: build-SYSTEM-VARIANT-1g1r.sh" echo # Count current state DOT_COUNT=$(ls build-*.1g1r.sh 2>/dev/null | wc -l) HYPHEN_COUNT=$(ls build-*-1g1r.sh 2>/dev/null | wc -l) echo "Current state:" echo " Scripts with DOTS (.1g1r.sh): $DOT_COUNT" echo " Scripts with HYPHENS (-1g1r.sh): $HYPHEN_COUNT" echo if [ $DOT_COUNT -eq 0 ]; then echo "✅ All scripts already use correct hyphen notation!" exit 0 fi echo "Scripts to be renamed:" ls build-*.1g1r.sh 2>/dev/null echo read -p "Proceed with renaming? (y/N): " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "Cancelled." exit 0 fi echo echo "Renaming scripts..." # Rename all dot notation scripts to hyphen notation for file in build-*.1g1r.sh; do if [ -f "$file" ]; then new_name=$(echo "$file" | sed 's/\.1g1r\.sh/-1g1r.sh/') echo " $file → $new_name" mv "$file" "$new_name" # Update internal script name references sed -i "s|# Script: $(basename "$file")|# Script: $(basename "$new_name")|g" "$new_name" sed -i "s|# Usage: \./$(basename "$file")|# Usage: \./$(basename "$new_name")|g" "$new_name" sed -i "s|# \./$(basename "$file")|# \./$(basename "$new_name")|g" "$new_name" fi done echo echo "=== STANDARDIZATION COMPLETE ===" NEW_DOT_COUNT=$(ls build-*.1g1r.sh 2>/dev/null | wc -l) NEW_HYPHEN_COUNT=$(ls build-*-1g1r.sh 2>/dev/null | wc -l) echo "Final state:" echo " Scripts with DOTS (.1g1r.sh): $NEW_DOT_COUNT" echo " Scripts with HYPHENS (-1g1r.sh): $NEW_HYPHEN_COUNT" echo echo "✅ All build scripts now use standardized hyphen notation!"