summaryrefslogtreecommitdiff
path: root/_selfcheck.lua
diff options
context:
space:
mode:
Diffstat (limited to '_selfcheck.lua')
-rw-r--r--_selfcheck.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/_selfcheck.lua b/_selfcheck.lua
index b4d0396..8b83fa5 100644
--- a/_selfcheck.lua
+++ b/_selfcheck.lua
@@ -1,7 +1,20 @@
local events = {}
local reports = {}
-assert(loadfile("panto-herdr-scm-1.rockspec"))
+-- Find the rockspec rather than naming it: the filename carries the version,
+-- so hardcoding it breaks this check on every release.
+--
+-- Deliberately shells out instead of using luv: the stubs below replace
+-- `package.preload.luv`, and a `require("luv")` up here would cache the real
+-- module first and quietly defeat them.
+local function find_rockspec()
+ local ls = assert(io.popen("ls -1 ./*.rockspec 2>/dev/null"))
+ local name = ls:read("l")
+ ls:close()
+ return name
+end
+
+assert(loadfile(assert(find_rockspec(), "no .rockspec in the repo root")))
package.preload.panto = function()
return {