Include version number in lsp and cli

Fixes #61.
This commit is contained in:
James Westman 2022-06-02 12:34:48 -05:00
parent 6f4d458855
commit 65691dfac6
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
4 changed files with 27 additions and 10 deletions

View file

@ -26,7 +26,13 @@ dirname = os.path.join(os.path.dirname(os.path.dirname(__file__)), "share", "blu
if os.path.isdir(os.path.join(dirname, "blueprintcompiler")):
sys.path.insert(0, dirname)
# Get the configured (or, if running from source, not configured) version number
version = "@VERSION@"
def literal(key):
return "@" + key + "@"
from blueprintcompiler import main
if __name__ == "__main__":
main.main()
main.main("uninstalled" if version == literal("VERSION") else version)