executables: Invoke loader to allow mixing of old and new import style
authorKim Alvefur <zash@zash.se>
Fri, 17 Mar 2023 16:29:07 +0100
changeset 12958 4f2accd99373
parent 12957 ebe3b2f96cad
child 12959 d32926897ca4
executables: Invoke loader to allow mixing of old and new import style Now both require"util.foo" and require"prosody.util.foo" should be equivalent.
prosody
prosodyctl
--- a/prosody	Tue Mar 21 14:33:29 2023 +0000
+++ b/prosody	Fri Mar 17 16:29:07 2023 +0100
@@ -51,6 +51,10 @@
 	return os.exit(1);
 end
 
+if not pcall(require, "prosody.loader") then
+	pcall(require, "loader");
+end
+
 local startup = require "util.startup";
 local async = require "util.async";
 
--- a/prosodyctl	Tue Mar 21 14:33:29 2023 +0000
+++ b/prosodyctl	Fri Mar 17 16:29:07 2023 +0100
@@ -51,6 +51,10 @@
 	return os.exit(1);
 end
 
+if not pcall(require, "prosody.loader") then
+	pcall(require, "loader");
+end
+
 local startup = require "util.startup";
 startup.prosodyctl();