Compare commits
5 Commits
282cb033a7
...
c28e511a8a
Author | SHA1 | Date |
---|---|---|
TEC | c28e511a8a | |
TEC | 8070522b82 | |
TEC | 4d41f1379c | |
TEC | 1f5136ae4c | |
TEC | e2af89fef1 |
|
@ -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.11-DEV.0"
|
||||
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
|
||||
|
|
|
@ -28,8 +28,8 @@ foreach(add_autoloads!, [
|
|||
exported = Bindings(callables = [
|
||||
:AbstractDataFrame, :All, :AsTable, :Between, :ByRow, :Cols,
|
||||
:DataFrame, :DataFrameRow, :DataFrames, :GroupedDataFrame,
|
||||
:InvertedIndex, :InvertedIndices, :Missing, :MissingException,
|
||||
:Missings, :Not, :PrettyTables, :SubDataFrame, :Tables, :aggregate,
|
||||
:InvertedIndex, :InvertedIndices, :MissingException, :Missings,
|
||||
:Not, :PrettyTables, :SubDataFrame, :Tables, :aggregate,
|
||||
:allcombinations, :allowmissing, :allowmissing!, :antijoin, :by,
|
||||
:coalesce, :colmetadata, :colmetadata!, :colmetadatakeys,
|
||||
:columnindex, :combine, :completecases, :crossjoin, :delete!,
|
||||
|
@ -38,11 +38,11 @@ foreach(add_autoloads!, [
|
|||
:emptymetadata!, :emptymissing, :fillcombinations, :flatten,
|
||||
:groupby, :groupcols, :groupindices, :innerjoin, :insertcols,
|
||||
:insertcols!, :ismissing, :leftjoin, :leftjoin!, :levels, :mapcols,
|
||||
:mapcols!, :metadata, :metadata!, :metadatakeys, :missing,
|
||||
:missings, :ncol, :nonmissingtype, :nonunique, :nrow, :order,
|
||||
:outerjoin, :passmissing, :proprow, :rename, :rename!, :repeat!,
|
||||
:rightjoin, :rownumber, :select, :select!, :semijoin, :skipmissings,
|
||||
:subset, :subset!, :transform, :transform!, :unique!, :unstack,
|
||||
:mapcols!, :metadata, :metadata!, :metadatakeys, :missings, :ncol,
|
||||
:nonmissingtype, :nonunique, :nrow, :order, :outerjoin,
|
||||
:passmissing, :proprow, :rename, :rename!, :repeat!, :rightjoin,
|
||||
:rownumber, :select, :select!, :semijoin, :skipmissings, :subset,
|
||||
:subset!, :transform, :transform!, :unstack,
|
||||
:valuecols])),
|
||||
PkgAutoloads(
|
||||
:DataToolkit,
|
||||
|
|
|
@ -6,14 +6,25 @@ const STARTUP_MANAGED_MESSAGE =
|
|||
const STARTUP_CONTENT = """
|
||||
$STARTUP_MANAGED_MESSAGE
|
||||
if VERSION < v"1.7"
|
||||
@warn "Setup disabled as Julia $VERSION < 1.7 is unsupported"
|
||||
@warn "Setup disabled as Julia \$VERSION < 1.7 is unsupported"
|
||||
else
|
||||
try
|
||||
using Setup
|
||||
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
|
||||
|
@ -70,7 +81,7 @@ end
|
|||
function update()
|
||||
(; startup, setup) = _install_paths()
|
||||
if readline(startup) != STARTUP_MANAGED_MESSAGE
|
||||
@warn "Startup.jl is not managed by Setup, re-installing"
|
||||
@warn "startup.jl is not managed by Setup, re-installing"
|
||||
return install()
|
||||
else
|
||||
write(startup, STARTUP_CONTENT)
|
||||
|
@ -79,6 +90,9 @@ function update()
|
|||
ispath(setup) || @warn "Setup missing, re-installing"
|
||||
return install()
|
||||
end
|
||||
success(Cmd(`git pull`, dir=setup)) ||
|
||||
if success(Cmd(`git pull origin master`, dir=setup))
|
||||
@info "Sucessfully updated Setup"
|
||||
else
|
||||
@error "Failed to update Setup"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue