Skip to content

Instantly share code, notes, and snippets.

@ileathan
Last active October 27, 2023 03:28
Show Gist options
  • Save ileathan/549457c4c51e86c6fbd8545f2e73e72f to your computer and use it in GitHub Desktop.
Save ileathan/549457c4c51e86c6fbd8545f2e73e72f to your computer and use it in GitHub Desktop.
Hacked Switch Tinfoil Custom Index Generation (From Games Directory)
# USAGE:
#
# Navigate to the directory that has all the switch rom files (your shop) and run this code.
# A shop.tfl file will be created in your local directory (you should be in your shop)
# which you can serve over http or however you chose to serve it.
# This just has the file location/size for now.
echo -e '{"files":[\n' >> shop.tfl;for f in *.nsp *.xci; do echo -e "{\n\"url\": \"$f\",\n\"size\": "$(stat "$f"|grep -oP "Size: \K\d+")"\n}," >> shop.tfl;done; echo "]}" >> shop.tfl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment