From 3e78f61d0f94387f62b4bd735518bfb22111c0cb Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Fri, 12 Oct 2018 16:07:32 -0400 Subject: [PATCH] store prefs in depot_path/prefs (#760) * store prefs in depot_path/prefs As a stopgap until we get proper package options (JuliaLang/Juleps#38), store JUPYTER preference in depot_path/prefs/IJulia so that it isn't forgotten when IJulia is updated. See also JuliaPy/PyCall.jl#589 * misplaced const --- deps/build.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deps/build.jl b/deps/build.jl index 81ce8cc6..4769e8e5 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -25,8 +25,11 @@ function prog_version(prog) return v"0.0" end end + +prefsfile = joinpath(first(DEPOT_PATH), "prefs", "IJulia") +mkpath(dirname(prefsfile)) -global jupyter = get(ENV, "JUPYTER", isfile("JUPYTER") ? readchomp("JUPYTER") : Compat.Sys.isunix() && !Compat.Sys.isapple() ? "jupyter" : "") +global jupyter = get(ENV, "JUPYTER", isfile(prefsfile) ? readchomp(prefsfile) : Compat.Sys.isunix() && !Compat.Sys.isapple() ? "jupyter" : "") if isempty(jupyter) jupyter_vers = nothing else @@ -117,7 +120,7 @@ deps = """ if !isfile("deps.jl") || read("deps.jl", String) != deps write("deps.jl", deps) end -write("JUPYTER", jupyter) +write(prefsfile, jupyter) ####################################################################### catch