Last active
July 22, 2026 22:44
-
-
Save instance-id/0c19d858ca3e12abf8c12d3a1b1ac9d2 to your computer and use it in GitHub Desktop.
Unity CLI wrapper to filter api.lab.amplitude.com errors
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Wrapper for Unity CLI that filters [Experiment] noise from stderr. | |
| # Caused by Amplitude Experiment SDK trying to reach api.lab.amplitude.com | |
| # Errors are non-fatal — CLI falls back to defaults. | |
| # Create a file named unitycli in $HOME/.local/bin | |
| # Paste this script in the new file | |
| # chmod +x "$HOME/.local/bin/unitycli" | |
| # Use 'unitycli' instead of 'unity' | |
| exec "$HOME/.unity/bin/unity" "$@" 2> >(awk ' | |
| /^\[Experiment\]/ { skip=1 } | |
| /^Error: getaddrinfo ENOTFOUND api\.lab\.amplitude\.com/ { skip=1 } | |
| skip && (/^\]/ || /^} \[\]/) { skip=0; next } | |
| skip { next } | |
| { print } | |
| ' >&2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment