Skip to content

Commit 14b7871

Browse files
committed
Simplify module loading to only use Base.require
- Remove fallback file inclusion logic - Only support properly installed packages in environment - Cleaner and more predictable behavior
1 parent da17c6b commit 14b7871

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

src/server.jl

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -106,35 +106,9 @@ function @main(args)
106106

107107
# Load the module
108108
try
109-
# Try to load the module
109+
# Load the module using Base.require
110110
mod_symbol = Symbol(module_name)
111-
112-
# Try to load the module using Base.require
113-
mod = try
114-
# First try to load it as a package in the current environment
115-
Base.require(Main, mod_symbol)
116-
catch
117-
# If that fails, check if it's already loaded
118-
if isdefined(Main, mod_symbol)
119-
getfield(Main, mod_symbol)
120-
else
121-
# Try to include it as a local file
122-
loaded = false
123-
for path in ["$module_name.jl", "src/$module_name.jl", "../$module_name.jl"]
124-
if isfile(path)
125-
include(abspath(path))
126-
loaded = true
127-
break
128-
end
129-
end
130-
131-
if loaded && isdefined(Main, mod_symbol)
132-
getfield(Main, mod_symbol)
133-
else
134-
error("Could not load module: $module_name")
135-
end
136-
end
137-
end
111+
mod = Base.require(Main, mod_symbol)
138112

139113
# Extract functions
140114
setup_fn = nothing

0 commit comments

Comments
 (0)