Created
July 18, 2016 00:21
-
-
Save jrabbit/c0002825e612e2f5545c2d6aca5b8998 to your computer and use it in GitHub Desktop.
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
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