Skip to content

Instantly share code, notes, and snippets.

@jbruchanov
Created January 23, 2017 18:20
Show Gist options
  • Save jbruchanov/45c066c9b22b8abedddd1c1c645ffa09 to your computer and use it in GitHub Desktop.
Save jbruchanov/45c066c9b22b8abedddd1c1c645ffa09 to your computer and use it in GitHub Desktop.
RetroPie
deleteConfig=false
params=("$@")
if [[ -z "${params[0]}" ]]; then
params=(-c "@MOUNT C /home/pi/RetroPie/roms/pc" -c "@C:")
elif [[ "${params[0]}" == *.sh ]]; then
bash "${params[@]}"
exit
else
file="${params[@]}"
folder=${file%/*}
configFile="$folder.conf"
mapperFile="$folder.map"
#echo $file
#echo $fileName
#echo $folder
#echo $configFile
#echo $mapperFile
if [ -f "$configFile" ]; then
params=(-conf $configFile)
params+=("$@")
elif [ -f "$mapperFile" ]; then
echo "Converting global config to specific one!"
eval "sed -e 's:mapper-SVN.map:$mapperFile:g' ~/.dosbox/dosbox-SVN.conf >> $configFile"
params=(-conf $configFile)
params+=("$@")
deleteConfig=true
fi
params+=(-exit)
fi
#echo "/opt/retropie/emulators/dosbox/bin/dosbox" "${params[@]}" >> /tmp/test
"/opt/retropie/emulators/dosbox/bin/dosbox" "${params[@]}"
if $deleteConfig ; then
#echo "DELETING" >> /tmp/test
rm "$configFile"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment