Skip to content

Commit

Permalink
added artifact for html.dat
Browse files Browse the repository at this point in the history
  • Loading branch information
rssdev10 committed Dec 11, 2024
1 parent db06448 commit 0b0d4d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[htmlnames]
git-tree-sha1 = "813db2bcdc4c5c4cc1cdbd6583e6c6bd7eaca024"
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ keywords = ["Entities", "HTML"]
license = "MIT"
desc = "Entities from HTML data tables"
authors = ["ScottPJones <[email protected]>"]
version = "1.0.2"
version = "1.0.3"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00"
StrTables = "9700d1a9-a7c8-5760-9816-a99fda30bb8f"

[compat]
Artifacts = "1"
RelocatableFolders = "1"
StrTables = "1"
julia = "1"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
12 changes: 12 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

println("Running HTML entity build in ", pwd())

using Artifacts
using Base.Filesystem
using StrTables

VER = UInt32(1)
Expand Down Expand Up @@ -99,3 +101,13 @@ else
println(sprint(showerror, ex, catch_backtrace()))
end
end

if isfile(savfile)
artifact_toml = joinpath(@__DIR__, "..", "Artifacts.toml")
hash = artifact_hash("htmlnames", artifact_toml)
path = artifact_path(hash)
isdir(path) || mkdir(path)
cp(savfile, joinpath(path, basename(savfile)), force=true)

println("Artifact had created at ", path)
end
3 changes: 2 additions & 1 deletion src/HTML_Entities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __precompile__()
"""
module HTML_Entities
using StrTables, RelocatableFolders
using Artifacts

VER = UInt32(1)

Expand All @@ -28,7 +29,7 @@ struct HTML_Table{T} <: AbstractEntityTable
ind2c::Vector{UInt16}
end

const DATA_PATH = @path joinpath(@__DIR__, "../data", "html.dat")
const DATA_PATH = @path joinpath(artifact"htmlnames", "html.dat")

function __init__()
global default = HTML_Table(StrTables.load(DATA_PATH)...)
Expand Down

0 comments on commit 0b0d4d9

Please sign in to comment.