Commit 9d923a03 authored by MichelJuillard's avatar MichelJuillard
Browse files
parent 489ca09c
git-tree-sha1 = "02b6b7dd187eab53400ddc820c4c32be55a570a7"
using Pkg
using Pkg.Artifacts
# This is the path to the Artifacts.toml we will manipulate
artifact_toml = joinpath(@__DIR__, "Artifacts.toml")
# Query the `Artifacts.toml` file for the hash bound to the name "dynare-preprocessor"
# (returns `nothing` if no such binding exists)
preprocessor_hash = artifact_hash("dynare-preprocessor", artifact_toml)
@show preprocessor_hash
if preprocessor_hash == nothing || !artifact_exists(preprocessor_hash)
# create_artifact() returns the content-hash of the artifact directory once we're finished creating it
preprocessor_hash = create_artifact() do artifact_dir
@show artifact_dir
# We create the artifact by simply downloading a few files into the new artifact directory
preprocessor_url_base = ""
download("$(preprocessor_url_base)/linux/64/preprocess.tar.gz", joinpath(artifact_dir, "preprocessor.tar.gz"))
# Now bind that hash within our `Artifacts.toml`. `force = true` means that if it already exists,
# just overwrite with the new content-hash. Unless the source files change, we do not expect
# the content hash to change, so this should not cause unnecessary version control churn.
bind_artifact!(artifact_toml, "dynare-preprocessor", preprocessor_hash)
# Get the path of the iris dataset, either newly created or previously generated.
# this should be something like `~/.julia/artifacts/dbd04e28be047a54fbe9bf67e934be5b5e0d357a`
dynare_preprocessor_path = artifact_path(preprocessor_hash)
@show dynare_preprocessor_path
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment