Skip to content

Add support for SOURCE_DATE_EPOCH #8

@joshudson

Description

@joshudson

I found it a little confusing trying to use this thing because it doesn't support reading the SOURCE_DATE_EPOCH environment variable.

It looks from the source code where the calling process's locale is used to parse the date argument, which is particularly non-convenient because the build is no longer independent of the caller's locale.

The code to do so looks something like this:

getDefaultValue: () => {
   var sourcedatestr = Environment.GetEnvironmentVariable("SOURCE_DATE_EPOCH");
   if (!string.IsNullOrEmpty(sourcedatestr))
      return new DateTime(unixdt * TimeSpan.TicksPerSecond + new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks, DateTimeKind.Utc);
   return DefaultDateTime;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions