Skip to content

Commit

Permalink
scratch space!
Browse files Browse the repository at this point in the history
  • Loading branch information
Pangoraw committed Dec 2, 2023
1 parent 62b748c commit 54bb16c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/Pluto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ export activate_notebook_environment

include("./precompile.jl")

const pluto_boot_environment_path = Ref{String}()

function __init__()
pluto_boot_environment_name = "pluto-boot-environment-$(VERSION)-$(PLUTO_VERSION)"
pluto_boot_environment_path[] = Scratch.@get_scratch!(pluto_boot_environment_name)

# Print a welcome banner
if (get(ENV, "JULIA_PLUTO_SHOW_BANNER", "1") != "0" &&
get(ENV, "CI", "🍄") != "true" && isinteractive())
Expand Down
1 change: 1 addition & 0 deletions src/evaluation/WorkspaceManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const SN = Tuple{ServerSession, Notebook}
"These expressions get evaluated whenever a new `Workspace` process is created."
process_preamble() = quote
Base.exit_on_sigint(false)
pluto_boot_environment_path = $(Pluto.pluto_boot_environment_path[])
include($(project_relative_path(joinpath("src", "runner"), "Loader.jl")))
ENV["GKSwstype"] = "nul"
ENV["JULIA_REVISE_WORKER_ONLY"] = "1"
Expand Down
6 changes: 4 additions & 2 deletions src/runner/Loader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ begin
local original_LP = LOAD_PATH
local original_AP = Base.ACTIVE_PROJECT[]

# Path to our notebook boot package environment
local runner_env_dir = pluto_boot_environment_path

local new_LP = ["@", "@stdlib"]
local new_AP = mktempdir()
local new_AP = runner_env_dir

try
# Activate the environment
Expand Down Expand Up @@ -58,6 +61,5 @@ begin
# Reset the pkg environment
copy!(LOAD_PATH, original_LP)
Base.ACTIVE_PROJECT[] = original_AP
rm(new_AP; recursive=true)
end
end
4 changes: 2 additions & 2 deletions src/runner/PlutoRunner/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoRunner"
uuid = "dc6b355a-2368-4481-ae6d-ae0351418d79"
authors = ["Michiel Dral <[email protected]>"]
version = "0.1.0"
authors = ["Michiel Dral <[email protected]>", "Fons van der Plas <[email protected]>", "Paul Berg <[email protected]>"]
version = "29.12.98"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down

0 comments on commit 54bb16c

Please sign in to comment.