Macro cmd_proc_macro::cmd_execute
source · cmd_execute!() { /* proc-macro */ }Expand description
This macro will yield an expression of type &’static [[u8; N]] which is the output of the command.
let hash = cmd_execute!("git rev-parse --short HEAD");
let date = cmd_execute!("git log -1 --format=%cd");
let latest_tag = cmd_execute!("git describe --tags --abbrev=0");
let sub_version = cmd_execute!("git rev-list `git describe --tags --abbrev=0` ..HEAD --count --first-parent");