Skip to content

Commit e33dfb2

Browse files
authored
Merge pull request #637 from JunoLab/sp/shorterbootrepl
shorten boot_repl script
2 parents 0f99270 + ab8f68e commit e33dfb2

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

script/boot_repl.jl

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
let
2-
# NOTE: Single quotes in this file break remote execution. So dont use them.
2+
# NOTE: Single quotes break remote execution. File needs to be shorter than 2000 chars.
33
if VERSION > v"0.7-"
44
port = parse(Int, popfirst!(ARGS))
55
else
66
port = parse(Int, shift!(ARGS))
77
end
88

9-
junorc = haskey(ENV, "JUNORC_PATH") ?
10-
joinpath(ENV["JUNORC_PATH"], "juno_startup.jl") :
11-
joinpath(homedir(), ".julia", "config", "juno_startup.jl")
9+
junorc = haskey(ENV, "JUNORC_PATH") ? joinpath(ENV["JUNORC_PATH"], "juno_startup.jl") : joinpath(homedir(), ".julia", "config", "juno_startup.jl")
1210
junorc = abspath(normpath(expanduser(junorc)))
1311

1412
if (VERSION > v"0.7-" ? Base.find_package("Atom") : Base.find_in_path("Atom")) == nothing
15-
p = VERSION > v"0.7-" ? (x) -> printstyled(x, color=:cyan, bold=true) : (x) -> print_with_color(:cyan, x, bold=true)
13+
p = VERSION > v"0.7-" ? x -> printstyled(x, color=:cyan, bold=true) : x -> print_with_color(:cyan, x, bold=true)
1614
p("\nHold on tight while we are installing some packages for you.\nThis should only take a few seconds...\n\n")
1715

1816
if VERSION > v"0.7-"
@@ -27,10 +25,9 @@ if (VERSION > v"0.7-" ? Base.find_package("Atom") : Base.find_in_path("Atom")) =
2725
end
2826

2927
# TODO: Update me when tagging a new relase:
30-
MIN_REQUIRED_ATOM_JL_VERSION = v"0.10.2"
31-
atom_outdated = false
28+
MIN_ATOM_VER = v"0.10.2"
29+
outdated = false
3230

33-
# check package versions:
3431
try
3532
if VERSION >= v"1.0-"
3633
using Pkg
@@ -40,12 +37,11 @@ try
4037
tomlpath = joinpath(dirname(atompath), "..", "Project.toml")
4138
atomversion = VersionNumber(Pkg.TOML.parsefile(tomlpath)["version"])
4239

43-
if atomversion < MIN_REQUIRED_ATOM_JL_VERSION
44-
atom_outdated = """
45-
Please upgrade Atom.jl to at least version `$(MIN_REQUIRED_ATOM_JL_VERSION)` with e.g. `using Pkg; Pkg.update()`.
40+
if atomversion < MIN_ATOM_VER
41+
outdated = """
42+
Please upgrade Atom.jl to at least version `$(MIN_ATOM_VER)` with e.g. `using Pkg; Pkg.update()`.
4643
47-
If the integrated REPL is non-functional as a consequence of an old version of Atom.jl you will
48-
need to update in a terminal, which you can open with e.g. the `Julia Client: Open A Repl` command.
44+
If the integrated REPL is non-functional, try an external terminal opened with the `Julia Client: Open External Repl` command.
4945
"""
5046
end
5147
end
@@ -54,7 +50,6 @@ catch err
5450
@error exception=err
5551
end
5652

57-
# load packages and connect to Atom:
5853
println("Starting Julia...")
5954

6055
try
@@ -66,14 +61,13 @@ try
6661
nothing
6762
end
6863
Atom.connect(port)
69-
if atom_outdated != false
70-
Atom.msg("versionwarning", atom_outdated)
64+
if outdated != false
65+
Atom.msg("versionwarning", outdated)
7166
end
7267
catch
73-
if atom_outdated != false
74-
printstyled("Outdated version of Atom.jl detected.\n", atom_outdated, "\n", color = Base.error_color())
68+
if outdated != false
69+
printstyled("Outdated version of Atom.jl detected.\n", outdated, "\n", color = Base.error_color())
7570
end
7671
rethrow()
7772
end
78-
7973
end

0 commit comments

Comments
 (0)