norns provide the include helper, that works like require but doesn't cache (uses dofile) and allows sourcing libs from the current script's folder (e.g. include("/lib/toto")).
most norns script rely on it instead of require for their own modules. having this helper fn would help porting norns libs to seamstress.
this PR also introduces seamstress.state.path, the path of the current script's folder (needed for requiring from current script's path).
as an added bonus we also get seamstress.state.script (absolute path to current script) and seamstress.state.name (script file name sans ext), behaving like norns' norns.state.<var>.
norns provide the
include
helper, that works likerequire
but doesn't cache (usesdofile
) and allows sourcing libs from the current script's folder (e.g.include("/lib/toto")
).most norns script rely on it instead of
require
for their own modules. having this helper fn would help porting norns libs to seamstress.this PR also introduces
seamstress.state.path
, the path of the current script's folder (needed for requiring from current script's path).as an added bonus we also get
seamstress.state.script
(absolute path to current script) andseamstress.state.name
(script file name sans ext), behaving like norns'norns.state.<var>
.