forked from trebst/compphys-2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.jl
58 lines (46 loc) · 2.12 KB
/
install.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using Pkg
get_global_env() = string("v", VERSION.major, ".", VERSION.minor)
get_global_env_folder() = joinpath(DEPOT_PATH[1], "environments", get_global_env())
get_active_env() = Base.active_project() |> dirname |> basename
# activate global environment (if not already active)
function activate_global_env()
if get_active_env() != get_global_env()
Pkg.REPLMode.pkgstr("activate --shared $(get_global_env())")
end
nothing
end
function rm_global_env()
if isdir(get_global_env_folder())
cd(get_global_env_folder()) do
isfile("Project.toml") && rm("Project.toml")
isfile("Manifest.toml") && rm("Manifest.toml")
end
end
nothing
end
# Installs all correct versions of our package dependencies.
function install()
activate_global_env()
# add all pkgs with specific versions (not pinned)
@info "Installiere alle Pakete..."
pkg"add [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]"
# precompile
@info "Bereite alle Pakete vor...."
pkg"precompile"
end
# Installs all correct versions of our package dependencies
# by overwriting(!) the existing global environment.
function install_overwrite()
rm_global_env()
activate_global_env()
# install IJulia
@info "Installiere IJulia"
pkg"add IJulia"
# add all pkgs with specific versions (not pinned)
@info "Installiere alle Pakete..."
pkg"add [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]"
# precompile
@info "Bereite alle Pakete vor...."
pkg"precompile"
end
nothing