Skip to content

Commit

Permalink
Merge pull request #162 from JuliaGizmos/s/fix-mac-os
Browse files Browse the repository at this point in the history
do JSON-based Jupyter config properly
  • Loading branch information
Shashi Gowda authored Jul 25, 2018
2 parents d6dce49 + a0937b7 commit 32d3b21
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ function install_ijulia_config()
$END_MARKER
"""
write(config_file, config_str)
config_file_json = joinpath(homedir(), ".jupyter", "jupyter_notebook_config.json")

if isfile(config_file_json)
dict = try
JSON.parse(read(config_file_json, String))
catch err
println(STDERR, "Error parsing Jupyter config file $config_file_json - fix it and build again or delete it to enable WebIO")
@goto jsondone
end
app = Base.@get! dict "NotebookApp" Dict()
nbext = Base.@get! app "nbserver_extensions" Dict()
nbext["jlstaticserve"] = true
open(config_file_json, "w") do io
prettyio = JSON.Writer.PrettyContext(io, 4)
JSON.print(prettyio, dict)
end
end
@label jsondone

write("load_paths.json", loadpath)
end

Expand Down

0 comments on commit 32d3b21

Please sign in to comment.