get_source_time

Function get_source_time 

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

Gets the modification time of the source code.

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

ยงErrors

Returns an error when:

  • SOURCE_DATE_EPOCH is non-empty and cannot be parsed as an u64
  • it failed to execute git
  • git exited with non-zero status
  • git wrote stdout data in an unexpected format