This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Pkg, LibGit2, CredentialsHandler | |
function update_registry(name) | |
tmpdir = mktempdir() | |
tmpfile = joinpath(tmpdir, "tmp.tar.gz") | |
CredentialsHandler.download("$(ENV["JULIA_PKG_SERVER"])/$(name).tar.gz", tmpfile) | |
@info "Downloaded Registry tmp at ", tmpfile | |
dest = joinpath(Pkg.depots1(), "registries") | |
@static if Sys.iswindows() | |
run(`$(joinpath(Sys.BINDIR, "7z.exe")) x -y $(tmpfile) -o$(tmpdir) -r`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
Make JuliaHub auth token available to Pkg.jl via environment variable | |
Usage: | |
1. print encoded token: `julia -e 'include("tokenmanager.jl"); encode_token("<Absolute path of token file>")'` | |
2. Set PkgServer in enviroment variable `JULIA_PKG_SERVER` | |
3. Set the encoded token string in `JULIA_TOKEN_ENCODED` | |
4. Place the token in current depot: `julia -e 'include("tokenmanager.jl"); store_token()'` | |
=# |