Created
June 1, 2023 20:25
-
-
Save shanecelis/a278ff00b978c68d1828ff1697016acd 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 -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