mirror of
https://github.com/TangentFoxy/lurker.git
synced 2025-07-27 18:42:18 +00:00
Add a mechanism to stop a hotswap from occurring.
This comes in handy when certain files need to be swapped with some other mechanism (for example - files which must be loaded into a specific environment). To stop a swap, return true from lurker.preswap. Does not break any existing usage of preswap.
This commit is contained in:
@@ -210,7 +210,11 @@ function lurker.hotswapfile(f)
|
||||
if lurker.state == "error" then
|
||||
lurker.exiterrorstate()
|
||||
end
|
||||
lurker.preswap(f)
|
||||
if lurker.preswap(f) then
|
||||
lurker.print("Hotswap of '{1}' aborted by preswap'", {f})
|
||||
lurker.resetfile(f)
|
||||
return
|
||||
end
|
||||
local modname = lurker.modname(f)
|
||||
local t, ok, err = lume.time(lume.hotswap, modname)
|
||||
if ok then
|
||||
|
Reference in New Issue
Block a user