korrect 0.0.2

A kubectl version managing shim that invokes the correct kubectl version ☸
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::process::Command;

fn main() {
    // TODO: add error checking
    let output = Command::new("git")
        .args(["rev-parse", "HEAD"])
        .output()
        .unwrap();

    let git_hash: String = String::from_utf8(output.stdout).unwrap();
    let mut git_short_hash = git_hash.clone();
    git_short_hash.truncate(8);
    println!("cargo:rustc-env=GIT_HASH={}", git_hash);
    println!("cargo:rustc-env=GIT_SHORT_HASH={}", git_short_hash);
}