Files
FEX-Emu--FEX/Scripts/FEXUpdateAOTIRCache.sh
T
crueter 14791ce7eb Scripts: Cleanups and POSIX compliance
- Makes all scripts POSIX-compliant
- General formatting and such
- shellcheck :)

Shell script is love. Shell script is life.

Signed-off-by: crueter <crueter@eden-emu.dev>
2026-01-26 23:53:33 -05:00

34 lines
767 B
Bash
Executable File

#!/bin/sh
FEX=${1:-FEXLoader}
echo "Using $FEX"
for fileid in ~/.fex-emu/aotir/*.path; do
filename=$(cat "$fileid")
args=""
# if L is 6 chars from the end, use localflags
case $fileid in
*L?????) _abi=--abilocalflags ;;
*) _abi=--no-abilocalflags ;;
esac
# if T is 7 chars from the end, use tso
case $fileid in
*T??????) _tso=--tsoenabled ;;
*) _tso=--no-tsoenabled ;;
esac
# if S is 8 chars from the end, use full smc
case $fileid in
*S???????) _smc=full ;;
*) _smc=mman ;;
esac
if [ -f "${fileid%.path}.aotir" ]; then
echo "$(basename "$fileid") has already been generated"
else
echo "Processing $(basename "$fileid") ($filename) with $args"
$FEX --aotirgenerate "$_abi" "$_tso" --smc="$_smc" "$filename"
fi
done