diff prosodyctl @ 14055:f47b4baa7934 13.0

prosody: Abort earlier on incompatible Lua version In order to minimize the amount of code we run before we bail out, as well as to prepare for rearranging loader and search paths.
author Kim Alvefur <zash@zash.se>
date Sun, 01 Feb 2026 15:18:14 +0100
parents 883d9d0ccd64
children 5b4efb5b798a
line wrap: on
line diff
--- a/prosodyctl	Sun Feb 01 14:49:34 2026 +0100
+++ b/prosodyctl	Sun Feb 01 15:18:14 2026 +0100
@@ -17,6 +17,13 @@
 
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 
+-- Check before first require, to preempt the probable failure
+if _VERSION < "Lua 5.2" then
+	io.stderr:write("Prosody is no longer compatible with Lua 5.1\n")
+	io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n")
+	return os.exit(1);
+end
+
 local function is_relative(path)
 	local path_sep = package.config:sub(1,1);
 	return ((path_sep == "/" and path:sub(1,1) ~= "/")
@@ -42,14 +49,6 @@
 	end
 end
 
------------
-
--- Check before first require, to preempt the probable failure
-if _VERSION < "Lua 5.2" then
-	io.stderr:write("Prosody is no longer compatible with Lua 5.1\n")
-	io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n")
-	return os.exit(1);
-end
 
 if not pcall(require, "prosody.loader") then
 	pcall(require, "loader");