Skip to content

Commit

Permalink
Create TZJData artifact constants (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
omus authored Jul 30, 2023
1 parent 4df8bad commit b6fbf44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/TZJData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ module TZJData

using Artifacts

const ARTIFACT_DIR = artifact"tzjdata"

const TZDATA_VERSION = let
artifact_dict = Artifacts.parse_toml(joinpath(@__DIR__, "..", "Artifacts.toml"))
url = first(artifact_dict["tzjdata"]["download"])["url"]
m = match(r"tzdata(?<version>\d{2}\d{2}?[a-z])", url)
m !== nothing ? m[:version] : error("Unable to determine tzdata version")
end

end

0 comments on commit b6fbf44

Please sign in to comment.