diff --git a/Project.toml b/Project.toml index ea75b69..c6e1606 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "DepotDelivery" uuid = "5c353f05-31b8-41b6-b09f-65e5456b8b1e" authors = ["Josh Day and contributors"] -version = "0.1.0" +version = "0.1.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/DepotDelivery.jl b/src/DepotDelivery.jl index d3134f0..30a2f8e 100644 --- a/src/DepotDelivery.jl +++ b/src/DepotDelivery.jl @@ -15,6 +15,18 @@ function restore!!(s::State) append!(empty!(DEPOT_PATH), s.depot_path) end +function sandbox(f::Function) + State = State() + try + f() + catch ex + @warn "DepotDelivery.sandbox failed" + rethrow(ex) + finally + restore!!(State) + end +end + #-----------------------------------------------------------------------------# build function build(path::String; platform = Base.BinaryPlatforms.HostPlatform()) state = State() @@ -61,6 +73,7 @@ function startup_script(depot_path::String, proj_name::String) import Pkg ENV["JULIA_DEPOT_PATH"] = "$depot_path" # Needed for Distributed.jl to work push!(empty!(DEPOT_PATH), "$depot_path") + Pkg.activate(joinpath("$depot_path", "dev", "$proj_name")) using $proj_name @info "Depot `$depot_path` initialized with project `$proj_name`." """