Function build_data::get_source_time [−][src]
pub fn get_source_time() -> Result<i64, String>
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 ani64
.- it failed to execute
git
git
exited with non-zero statusgit
wrote stdout data that cannot be parsed as ani64
.
Panics
Panics if git
writes non-UTF bytes to stdout.