2017-09-29 20:00:21 +02:00
|
|
|
local source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
|
2021-03-12 21:15:00 +01:00
|
|
|
if source_date_epoch and source_date_epoch ~= '' then
|
2017-09-29 20:00:21 +02:00
|
|
|
local old_osdate = os.date
|
|
|
|
os.date = function(format, timestamp) -- luacheck: ignore
|
|
|
|
if timestamp then
|
|
|
|
return old_osdate(format, timestamp)
|
|
|
|
end
|
|
|
|
format = "!" .. format
|
|
|
|
return old_osdate(format, source_date_epoch)
|
|
|
|
end
|
|
|
|
end
|