aboutsummaryrefslogtreecommitdiffstats
path: root/build/util.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-11-22 11:07:24 +0000
committers-ol <s-ol@users.noreply.github.com>2018-11-22 11:07:24 +0000
commite98c5becba67d642b5fd5c6e4a206d79749e8953 (patch)
tree34965a21413107e089a77da8886dd85022c9e651 /build/util.moon
parentmove glitch cube, torus4d to experiments (diff)
downloadmmm-e98c5becba67d642b5fd5c6e4a206d79749e8953.tar.gz
mmm-e98c5becba67d642b5fd5c6e4a206d79749e8953.zip
bundle binary files as URLs
Diffstat (limited to 'build/util.moon')
-rw-r--r--build/util.moon16
1 files changed, 16 insertions, 0 deletions
diff --git a/build/util.moon b/build/util.moon
new file mode 100644
index 0000000..b9c9613
--- /dev/null
+++ b/build/util.moon
@@ -0,0 +1,16 @@
+require 'lfs'
+
+get_path = (root) ->
+ cwd = lfs.currentdir!
+ path = ''
+
+ while root\find '^%.%./'
+ root = root\match '^%.%./(.*)'
+ cwd, trimmed = cwd\match '(.*)(/[^/]+)$'
+ path = trimmed .. path
+
+ path
+
+{
+ :get_path
+}