From 33089b4074c90fccc25a21cae5c90dd12a88a60d Mon Sep 17 00:00:00 2001 From: Niels1006 Date: Fri, 21 Feb 2025 12:16:36 +0100 Subject: [PATCH] Get developer package path in __init__ function, so it runs after loading of the module instead of only when precompiling. Fixes #18 --- src/PlutoBoard.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/PlutoBoard.jl b/src/PlutoBoard.jl index 19b59ce..9b464a8 100644 --- a/src/PlutoBoard.jl +++ b/src/PlutoBoard.jl @@ -18,9 +18,13 @@ include("fileserver/FileServer.jl") include("websocket/WebSocket.jl") include("plugins/LoadPlugin.jl") +function __init__() + global SERVE_DIR = joinpath(pwd(), "static") +end + -const plutoboard_filepath = dirname(dirname(pathof(PlutoBoard))) -const config = TOML.parsefile(plutoboard_filepath * "/config/config.toml") +plutoboard_filepath = dirname(dirname(pathof(PlutoBoard))) +config = TOML.parsefile(plutoboard_filepath * "/config/config.toml") html_path::Union{String,Nothing} = nothing @@ -33,8 +37,6 @@ stylesheet_urls::Array{String} = [] fileserver = nothing websocket = nothing -const SERVE_DIR = joinpath(pwd(), "static") - # Plugins js_files_to_load::Array{String} = []