#!/bin/bash ################################################################################ # Script: build-pcenginecd-eng-1g1r.sh # Description: Builds a 1G1R (One Game One ROM) set for the PC Engine CD, # focusing on English language ROMs. This script sets up the # environment and calls the main processing script with the appropriate # parameters. # # Usage: ./build-pcenginecd-eng-1g1r.sh # # Dependencies: # - nointro-processor.sh # - config.sh # - logger.sh # - config-arrays.sh # # Example: # ./build-pcenginecd-eng-1g1r.sh ################################################################################ # Set file permissions - all generated files readable/writable by all umask 000 # Determine the directory of the current script SCRIPT_DIR="$(dirname "$(realpath "$0")")" # Determine the project root directory PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" # Load configuration and logger from the script's directory source "${PROJECT_ROOT}/core/config.sh" source "${PROJECT_ROOT}/core/logger.sh" source "${PROJECT_ROOT}/core/config-arrays.sh" # Override languageArray to only include En LANGUAGE_ARRAY_OVERRIDE="En" source "${PROJECT_ROOT}/core/config-arrays.sh" # Re-source to apply the override # Log the script name when it is called log "DEBUG" "Starting script: $(basename "$0")" # Function to set up the environment set_environment() { SYSTEM="pcenginecd" FILTER="eng.1g1r" SOURCESITE="myrient.erista.me/files/Redump" SOURCESYSTEM="NEC - PC Engine CD & TurboGrafx CD" log "DEBUG" "Environment set up for $SYSTEM with filter $FILTER" } # Function to run the processing script run_processing() { log "INFO" "Starting processing for $SYSTEM with filter $FILTER" "${PROJECT_ROOT}/tools/nointro-processor.sh" -i -d -s "$SYSTEM" -f "$FILTER" -ss "$SOURCESITE" -sy "$SOURCESYSTEM" -l -r -k -u if [ $? -ne 0 ]; then log "ERROR" "Processing failed for $SYSTEM" exit 1 fi } # Function to display a summary display_summary() { log "INFO" "Processing completed successfully for $SYSTEM" log "INFO" "Summary:" log "INFO" " - System: $SYSTEM" log "INFO" " - Filter: $FILTER" log "INFO" " - Source: $SOURCESITE/$SOURCESYSTEM" } # Main script execution main() { set_environment run_processing display_summary } # Run the main function main