#!/bin/bash # Get the XDG data home or default if not set, then append a 'soniccd' folder. data_folder="${XDG_DATA_HOME:-${HOME}/.local/share}/soniccd" # Check if it exists, if not, create it and exit with error code 1. if [[ ! -d "$data_folder" ]]; then mkdir -p "$data_folder" echo "Created data folder in '$data_folder', please copy the game's data" \ "files there and run this launcher again." exit 1 fi cd "$data_folder" /usr/bin/RSDKv3 exit_code=$? # When implemented, exit code 1 will indicate missing data. # Let's hope that doesn't change, right? :D if [[ $exit_code -eq 1 ]]; then echo "'/usr/bin/soniccd' exited with error code 1, did you forget to" \ "copy the game's data files to '$data_folder'?" fi exit $exit_code