Add Dev Container Configuration Files (#7)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
println("Executing user-specific startup file (", @__FILE__, ")...")
|
||||
|
||||
# https://github.com/julia-vscode/julia-vscode/issues/3304
|
||||
project = (Base.JLOptions().project != C_NULL ?
|
||||
unsafe_string(Base.JLOptions().project) :
|
||||
get(ENV, "JULIA_PROJECT", nothing))
|
||||
if !isnothing(project)
|
||||
Pkg.activate(; io=devnull)
|
||||
end
|
||||
|
||||
try
|
||||
using Revise
|
||||
println("Revise started")
|
||||
catch e
|
||||
@warn "Error initializing Revise" exception=(e, catch_backtrace())
|
||||
end
|
||||
|
||||
if !isnothing(project) &&
|
||||
# https://github.com/julia-vscode/julia-vscode/issues/3304
|
||||
!startswith(Base.load_path_expand(Base.LOAD_PATH[end]), project)
|
||||
|
||||
if startswith(project, "@")
|
||||
if startswith(project, "@.")
|
||||
if isnothing(Base.current_project())
|
||||
Pkg.activate(joinpath("$(ENV["HOME"])", ".julia",
|
||||
"environments", "v$(VERSION.major).$(VERSION.minor)"))
|
||||
else
|
||||
Pkg.activate(Base.current_project(); io=devnull)
|
||||
end
|
||||
else
|
||||
Pkg.activate(Base.load_path_expand(project); io=devnull)
|
||||
end
|
||||
else
|
||||
Pkg.activate(abspath(expanduser(project)); io=devnull)
|
||||
end
|
||||
else
|
||||
if isfile(joinpath(pwd(), "Project.toml")) &&
|
||||
isfile(joinpath(pwd(), "Manifest.toml"))
|
||||
|
||||
Pkg.activate(pwd())
|
||||
else
|
||||
Pkg.activate(joinpath("$(ENV["HOME"])", ".julia", "environments",
|
||||
"v$(VERSION.major).$(VERSION.minor)"))
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
if !in(MIME("application/pdf"), IJulia.ijulia_mime_types)
|
||||
IJulia.register_mime(MIME("application/pdf"))
|
||||
end
|
||||
17
.devcontainer/julia-base/scripts/usr/local/bin/postStartCommand.sh
Executable file
17
.devcontainer/julia-base/scripts/usr/local/bin/postStartCommand.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2023 b-data GmbH.
|
||||
# Distributed under the terms of the MIT License.
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p "${HOME}/.julia/config"
|
||||
|
||||
# Copy user-specific startup files if home directory is bind mounted
|
||||
if [ ! -f "${HOME}/.julia/config/startup_ijulia.jl" ]; then
|
||||
cp -a /etc/skel/.julia/config/startup_ijulia.jl \
|
||||
"${HOME}/.julia/config"
|
||||
fi
|
||||
if [ ! -f "${HOME}/.julia/config/startup.jl" ]; then
|
||||
cp -a /etc/skel/.julia/config/startup.jl \
|
||||
"${HOME}/.julia/config"
|
||||
fi
|
||||
Reference in New Issue
Block a user