git-tags-semver 0.6.2

Tool to extract SemVer Version Information from annotated git tags
Documentation
use std::fs;
use std::path::Path;
use std::str::from_utf8;

use git_tags_semver::{Lang, Rust};

/// This example serves as a minimal solution to create and read a version file. It's recommended to create
/// the build.rs file and use the generated version.rs file as described in the README.
fn main() {
    // Extract the version information and generate the corresponding code
    let out = Rust.fmt_version_getter(&git_tags_semver::parse_git_describe().unwrap());

    // Write the generated version information code to version.rs in the OUT_DIR directory
    let dest_path = Path::new(&".").join("version.rs");
    fs::write(&dest_path, &out).unwrap();

    let version_file = fs::read("./version.rs").unwrap();
    let version_string = from_utf8(&version_file).unwrap();
    println!("{:?}", version_string);
}