Skip to content

Commit

Permalink
add sjtug mirror (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 authored Aug 5, 2020
1 parent c96f916 commit 273e2a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "JuliaZH"
uuid = "652e05fd-ed22-5b6c-bf99-44e63a676e5f"
version = "1.5.0"
version = "1.5.1"

[deps]
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Expand Down
6 changes: 4 additions & 2 deletions src/JuliaZH.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ const mirrors = Dict{String,String}()

mirrors["BFSU"] = "https://mirrors.bfsu.edu.cn/julia/static"
mirrors["default"] = "https://pkg.julialang.org"
mirrors["SJTUG"] = "https://mirrors.sjtug.sjtu.edu.cn/julia"

"""
set_mirror(mirror_name="BFSU")
设置镜像源为 `mirror_name`。目前可以选择的有:
- `"BFSU"`: TUNA支持的境内源
- `"BFSU"`: 北京外国语大学开源软件镜像站
- `"SJTUG"`: 上海交通大学Linux用户组 (SJTUG) 软件源镜像服务
- `"default"`: Julia官方默认源
"""
function set_mirror(mirror_name = "BFSU")
Expand Down Expand Up @@ -61,7 +63,7 @@ function generate_startup(mirror_name::String = "BFSU")

is_upstream_unchanged = occursin(new_upstream, old_upstream) || occursin(old_upstream, new_upstream)
if !is_upstream_unchanged
@info "更新 PkgServer" 新服务器地址=new_upstream 原服务器地址=old_upstream 配置文件=config_path
@info "更新 PkgServer" 新服务器地址=new_upstream 原服务器地址=old_upstream 配置文件=startup_path
startup_lines[idx] = new_line
end
end
Expand Down

0 comments on commit 273e2a8

Please sign in to comment.