djr 0.0.2

Djot rendering CLI based on the djot crate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use cargo_lock::Lockfile;
use std::path::PathBuf;

fn main() {
    let lockfile = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("Cargo.lock");
    let lock = Lockfile::load(lockfile).unwrap();

    for pkg in lock.packages.iter() {
        // Populate the build env with the version of the djr dependency
        if pkg.name.as_str() == "djr" {
            println!("cargo:rustc-env=DJR_VERSION={}", pkg.version);
        }
    }
}