Skip to content

Commit

Permalink
feat: read TZDIR if it's in the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
algebraic-dev committed Nov 26, 2024
1 parent 3e68695 commit 41784ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Std/Time/Zoned/Database/TZdb.lean
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ instance : Std.Time.Database TZdb where
getLocalZoneRules db := localRules db.localPath

getZoneRules db id := do
let env ← IO.getEnv "TZDIR"

if let some path := env then
let result ← readRulesFromDisk path id
return result

for path in db.zonesPaths do
if ← System.FilePath.pathExists path then
let result ← readRulesFromDisk path id
Expand Down

0 comments on commit 41784ab

Please sign in to comment.