Skip to content

Commit

Permalink
store prefs in depot_path/prefs (#760)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stevengj authored Oct 12, 2018
1 parent b79779e commit 3e78f61
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3e78f61

Please sign in to comment.