set_SOURCE_EPOCH_TIME

Function set_SOURCE_EPOCH_TIME 

Source
pub fn set_SOURCE_EPOCH_TIME() -> Result<(), String>
Expand description

Sets the SOURCE_EPOCH_TIME env variable.

Call this from build.rs. Use env! in your main.rs to use the variable.

Example value: "1618370707"

Reads the SOURCE_DATE_EPOCH env var if set. Otherwise, runs git to get the value.

ยงErrors

Returns an error when:

  • SOURCE_DATE_EPOCH env var is non-empty and invalid
  • it fails to get the timestamp from git