Skip to content

Instantly share code, notes, and snippets.

@demaniak
Last active April 8, 2020 13:46
Show Gist options
  • Save demaniak/1130309474635a82353f4c846a4a9912 to your computer and use it in GitHub Desktop.
Save demaniak/1130309474635a82353f4c846a4a9912 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Simple wrapper script for the python visualizer created by [Kobus van Schoor](https://gist.github.com/kobus-v-schoor)
# Runs the visualizer in a docker container
#
if [ ! -f viz.py ]; then
curl -L https://gist.github.com/kobus-v-schoor/ec1923bb09858a5037df21444aeabbcd/raw/7c282e7fac668e1771d0ccd29dc583cb7738430c/viz.py > viz.py
chmod +x viz.py
fi
PATH_TO_LOGS=$(readlink -f $1)
echo "Target folder is $PATH_TO_LOGS"
# Comment out/remove the next two lines if you do not gzip your match logs
echo unzipping $PATH_TO_LOGS
gunzip -r $PATH_TO_LOGS
docker run -it --rm -v "$PATH_TO_LOGS:/src" -v "$PWD/viz.py:/src/viz.py" -w /src python:3.8.2 /src/viz.py
# Comment out/remove the next 2 lines if you do not gzip your match logs
echo zip it again
gzip -r $PATH_TO_LOGS
@demaniak
Copy link
Author

demaniak commented Apr 8, 2020

Run like so:

./run-viz.sh /path/to/match/logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment