Last active
November 7, 2023 22:44
-
-
Save EoD/8f620ac41729ca2ffa95eda1297f9838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eEu | |
# Generate luacheckrc from BizHawk homepage | |
# Format is roughly | |
# </li></ul><div class="p"><b>movie.getrerecordcount</b><br /> | |
# But there are some sentences as well, so make sure that no whitespace ("\S") is there and that there is a dot "\." | |
lua_functions="$(curl https://tasvideos.org/Bizhawk/LuaFunctions | grep -o "<div class=\"p\"><b>\S\+\.\S\+</b>" | sed 's,.*<b>\(.*\)</b>,\1,')" | |
echo "read_globals = {" | |
for object in $(awk -F. '{ print $1 }' <<< "${lua_functions}" | sort | uniq); do | |
echo " ${object} = {" | |
echo " fields = {" | |
grep "${object}" <<< "${lua_functions}" | awk -F. '{ print $2 }' | sort | uniq | while IFS= read -r field | |
do | |
echo " ${field} = {}," | |
done | |
echo " }," | |
echo " }," | |
done | |
echo "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment