Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local serve in ReferenceUpdater #4444

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ReferenceUpdater/src/local_server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function serve_update_page_from_dir(folder)

folder = realpath(folder)
@assert isdir(folder) "$folder is not a valid directory."
split_scores(folder)

router = HTTP.Router()

Expand Down Expand Up @@ -145,7 +146,6 @@ function serve_update_page(; commit = nothing, pr = nothing)
tmpdir = mktempdir()
unzip(filepath, tmpdir)
rm(filepath)
split_scores(tmpdir)
URL_CACHE[download_url] = tmpdir
else
tmpdir = URL_CACHE[download_url]
Expand Down Expand Up @@ -186,13 +186,15 @@ end


function split_scores(path)
isfile(joinpath(path, "scores_table.tsv")) && return

# Load all refimg scores into a Dict
# `filename => (score_glmakie, score_cairomakie, score_wglmakie)`
data = Dict{String, Vector{Float64}}()
open(joinpath(path, "scores.tsv"), "r") do file
for line in eachline(file)
score, filepath = split(line, '\t')
pieces = split(filepath, '/')
pieces = splitpath(filepath)
backend = pieces[1]
filename = join(pieces[2:end], '/')

Expand Down Expand Up @@ -227,4 +229,5 @@ function split_scores(path)
end
end

return
end
Loading