Skip to content

Commit

Permalink
small update to build
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Feb 13, 2024
1 parent c06a3ab commit 221a1a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DepotDelivery"
uuid = "5c353f05-31b8-41b6-b09f-65e5456b8b1e"
authors = ["Josh Day <[email protected]> and contributors"]
version = "0.1.2"
version = "0.1.3"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
12 changes: 3 additions & 9 deletions src/DepotDelivery.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ function restore!!(s::State)
end

function sandbox(f::Function)
State = State()
state = State()
try
f()
catch ex
@warn "DepotDelivery.sandbox failed"
rethrow(ex)
finally
restore!!(State)
restore!!(state)
end
end

#-----------------------------------------------------------------------------# build
function build(path::String; platform = Base.BinaryPlatforms.HostPlatform())
state = State()
path = abspath(path)
depot = mktempdir()
try
sandbox() do
proj_file = joinpath(path, "Project.toml")
proj_file = isfile(proj_file) ? proj_file : joinpath(path, "JuliaProject.toml")
isfile(proj_file) || error("No Project.toml or JuliaProject.toml found in `$path`.")
Expand All @@ -57,11 +56,6 @@ function build(path::String; platform = Base.BinaryPlatforms.HostPlatform())

open(io -> TOML.print(io, build_spec), joinpath(depot, "config", "depot_build.toml"), "w")
open(io -> print(io, startup_script(name)), joinpath(depot, "config", "depot_startup.jl"), "w")
catch ex
@warn "DepotDelivery.build failed"
rethrow(ex)
finally
restore!!(state)
end

return depot
Expand Down

2 comments on commit 221a1a7

@joshday
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/100769

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.3 -m "<description of version>" 221a1a74bb2235c1a8ca931ea6b0f06e3b602dbf
git push origin v0.1.3

Please sign in to comment.