From e7c8fe219686aa327032154484bf78be86c0baaa Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Mon, 23 Oct 2023 14:45:07 +0300 Subject: [PATCH] feat(cli): Allow multiple runtime SILE_PATH segments (backport from develop branch) --- sile.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sile.in b/sile.in index b0bd02964..61f0f065d 100755 --- a/sile.in +++ b/sile.in @@ -6,7 +6,11 @@ SHARED_LIB_EXT = "@SHARED_LIB_EXT@" -- At this point at run time we may or may not have anything useful in package.path, -- so require() isn't something we can rely on. -local status = pcall(dofile, "@SILE_PATH@/core/pathsetup.lua") +local status +for path in string.gmatch("@SILE_PATH@", "[^;]+") do + status = pcall(dofile, path .. "/core/pathsetup.lua") + if status then break end +end if not status then dofile("./core/pathsetup.lua") end