run_command!() { /* proc-macro */ }
Expand description
Run a command at compile time, and return the output as a byte slice.
The output is a static &u8, and can be used for the value of consts. If the command fails to run, a compile error is generated.
If the output ends with a newline, it is stripped. At most one newline character is stripped this way.
For example:
use compile_time_run::run_command;
const VALUE : &'static [u8] = run_command!("echo", "Hello World!");