Skip to content

Added a --version flag

Michael Aaron Murphy requested to merge drosseau:master into master

Created by: drosseau

Adds a flag to display the version and git rev.

$ ion --version
ion 1.0.5 (x86_64-unknown-linux-gnu)
rev d1d02727024f98b199490122604bc8a7712c2fe4

Issues

include!(concat!(env!("OUT_DIR"), "/version_string")) might eventually be an issue if / isn't the default path separator though. You can't use Path::MAIN_SEPARATOR there.

First this tries to get the revision from git rev-parse master and then falls back to trying the .git/refs/heads/master file if the command fails. That kinda locks in the build to master branch, but I think that is OK?

(Sorry about the messy commits..)

Closes #515 (closed)

Merge request reports