#!/bin/bash rootdir=$1 curl https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt | grep -v '^#' | grep -v '^$' | sed s/',$'//g > mappings.txt filelen=$(wc -l mappings.txt | cut -d ' ' -f 1) cat > ${rootdir}/include/akgl/SDL_GameControllerDB.h <> ${rootdir}/include/akgl/SDL_GameControllerDB.h; fi printf " \"${LINE}\"" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h; counter=$((counter + 1)) done printf "\n};\n" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h printf "#endif // _SDL_GAMECONTROLLERDB_H_\n" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h