From c83337b6a68be51242cee25802fa75143fc335de Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 12 Sep 2022 19:55:34 +0200 Subject: [PATCH] .bam/path.lua: Adding ModuleRelative() --- .bam/path.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.bam/path.lua b/.bam/path.lua index b798e61..bcfd657 100644 --- a/.bam/path.lua +++ b/.bam/path.lua @@ -4,6 +4,11 @@ function ModuleDir() return PathDir(ModuleFilename()) end +-- Strip ModuleDir() of the beginning of path +function ModuleRelative(path) + return string.gsub(path, "^" .. ModuleDir() .. "/", "") +end + -- Make the path relative to the current working directory -- and ModuleDir() function RelPath(path)