Skip to content

Instantly share code, notes, and snippets.

@shanecelis
Created June 1, 2023 20:25
Show Gist options
  • Save shanecelis/a278ff00b978c68d1828ff1697016acd to your computer and use it in GitHub Desktop.
Save shanecelis/a278ff00b978c68d1828ff1697016acd to your computer and use it in GitHub Desktop.
#!/bin/bash -e
# unity-log
usage() {
echo "Usage: unity-log [-te] <Company> <Application>" >&2;
echo " -t tail log" >&2;
echo " -e editor log" >&2;
exit 2;
}
cmd=echo;
log="";
while getopts "eth" o; do
case "${o}" in
e) log="$LOCALAPPDATA\Unity\Editor\Editor.log";;
t) cmd="tail -f";;
*) usage ;;
esac
done
shift $((OPTIND-1));
if [ ! "$log" ] && [ $# -ne 2 ]; then
echo "error: expected two arguments." >&2;
usage;
exit 1;
fi
log="${log:=$USERPROFILE/AppData/LocalLow/$1/$2/Player.log}";
$cmd "$log";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment