Skip to content

Instantly share code, notes, and snippets.

@jrabbit
Created July 18, 2016 00:21
Show Gist options
  • Save jrabbit/c0002825e612e2f5545c2d6aca5b8998 to your computer and use it in GitHub Desktop.
Save jrabbit/c0002825e612e2f5545c2d6aca5b8998 to your computer and use it in GitHub Desktop.
def get_version():
"""this is actually complicated if we're in a container enviroment.
Maybe use taskc?!"""
x = check_output(["taskd", "-v"])
l = x.strip().split("\n")[0]
# '\x1b[1mtaskd 1.2.0\x1b[0m e2d145b built for linux'
version = l.split()[1].split("\x1b")[0]
platform = l.split()[-1]
git_rev = l.split()[2]
return {"version": version, "platform": platform, "git_rev": git_rev}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment