Compare commits
2 Commits
0244858177
...
c44288dbc0
Author | SHA1 | Date |
---|---|---|
TEC | c44288dbc0 | |
TEC | cff6ba8238 |
|
@ -27,7 +27,11 @@ const STACK_SPEC = Pkg.REPLMode.CommandSpec(
|
|||
Stack another environment.
|
||||
""",
|
||||
description = "Stack another environment",
|
||||
completions = Pkg.REPLMode.complete_activate,
|
||||
completions = if VERSION <= v"1.10"
|
||||
Pkg.REPLMode.complete_activate
|
||||
else
|
||||
Pkg.REPLMode.get_complete_function(:complete_activate)
|
||||
end,
|
||||
should_splat = false,
|
||||
arg_count = 0 => Inf)
|
||||
|
||||
|
|
15
src/Setup.jl
15
src/Setup.jl
|
@ -46,13 +46,16 @@ function ensureglobalpkg(pkg::String)
|
|||
if isnothing(Base.find_package(pkg))
|
||||
Pkg = lazypkg()
|
||||
oldproj = Base.current_project()
|
||||
Pkg.activate()
|
||||
@info "Installing $pkg"
|
||||
lazypkg().add(pkg)
|
||||
if isnothing(oldproj)
|
||||
try
|
||||
Pkg.activate()
|
||||
else
|
||||
Pkg.activate(oldproj)
|
||||
@info "Installing $pkg"
|
||||
Pkg.add(pkg)
|
||||
finally
|
||||
if isnothing(oldproj)
|
||||
Pkg.activate()
|
||||
else
|
||||
Pkg.activate(oldproj)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,18 @@ else
|
|||
catch e
|
||||
if e isa ArgumentError && isnothing(Base.find_package("Setup")) # Package not found in current path
|
||||
let pkg_id = Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg")
|
||||
Base.require(pkg_id).develop(path=joinpath(@__DIR__, "Setup"))
|
||||
Pkg = Base.require(pkg_id)
|
||||
cproj = Base.current_project()
|
||||
try
|
||||
Pkg.activate()
|
||||
Pkg.develop(path=joinpath(@__DIR__, "Setup"))
|
||||
finally
|
||||
if isnothing(cproj)
|
||||
Pkg.activate()
|
||||
else
|
||||
Pkg.activate(cproj)
|
||||
end
|
||||
end
|
||||
end
|
||||
using Setup
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue