aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/defaults.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bruiser/defaults.lua17
1 files changed, 15 insertions, 2 deletions
diff --git a/bruiser/defaults.lua b/bruiser/defaults.lua
index 8dd09df..d3344f0 100644
--- a/bruiser/defaults.lua
+++ b/bruiser/defaults.lua
@@ -1,2 +1,15 @@
-package.path = package.path .. ";/home/bloodstalker/.luarocks/share/lua/5.3/?.lua;/home/bloodstalker/.luarocks/share/lua/5.3/?/init.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua;./?.lua;./?/init.lua"
-package.cpath = package.cpath .. ";/home/bloodstalker/.luarocks/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.3/loadall.so;./?.so"
+-- bruiser default script.
+-- This is run everytime bruiser is called.
+
+-- adds luarocks' path and cpath to bruiser
+local luarocks_handle = io.popen("luarocks path --bin")
+for line in luarocks_handle:lines() do
+ local path = string.match(line, "LUA_PATH%s*=%s*('.+')")
+ local cpath = string.match(line, "LUA_CPATH%s*=%s*('.+')")
+ if path ~= nil then
+ package.path = package.path..path
+ end
+ if cpath ~= nil then
+ package.cpath = package.cpath..cpath
+ end
+end