Skip to content

Instantly share code, notes, and snippets.

@atteneder
Created May 28, 2020 08:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atteneder/a5acd9ae1dad5c6b5a1738e86e84783d to your computer and use it in GitHub Desktop.
Save atteneder/a5acd9ae1dad5c6b5a1738e86e84783d to your computer and use it in GitHub Desktop.
Extract a Unity project's version (found in Player settings) from command line (macOS/Linux)
#!/bin/sh
# The current working directory has to be the root of the project
cd /path/to/UnityProject
# Extract into variable via sed
PROJECT_VERSION=$(sed -nE 's/bundleVersion: (.+)/\1/p' ProjectSettings/ProjectSettings.asset)
# Put it to use
echo $PROJECT_VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment