Skip to content

Commit

Permalink
Allow package to be installed anywhere and still find non-Lua assets
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque authored and ctrlcctrlv committed Aug 16, 2022
1 parent e664c65 commit f71e218
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/sile-logos/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ local base = require("packages.base")
local package = pl.class(base)
package._name = "sile-logos"

local function script_path ()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)")
end

function package:_init ()
base._init(self)
end
Expand All @@ -13,7 +18,7 @@ function package:registerCommands ()
-- registered using \define{} macros in the SIL input format. They should
-- probably be refactored using Lua, but to get the party started with SILE
-- v0.13 package support we'll just process them here.
SILE.processFile("packages/sile-logos/macros.sil")
SILE.processFile(script_path() .. "macros.sil")
end

return package

0 comments on commit f71e218

Please sign in to comment.