compile_time_run

Macro run_command_str

Source
run_command_str!() { /* proc-macro */ }
Expand description

Run a command at compile time, and return the output as a str.

The output is a static &str, 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_str;
const VALUE : &'static str = run_command_str!("echo", "Hello World!");