prosodyctl: Use luarocks status code as exit code
authorKim Alvefur <zash@zash.se>
Thu, 21 Jan 2021 19:02:03 +0100
changeset 11297 cd27ac5e5afe
parent 11296 ad5cd9b0f8de
child 11298 a1939b261f67
prosodyctl: Use luarocks status code as exit code Enables some shell level error handling
prosodyctl
--- a/prosodyctl	Thu Jan 21 18:50:19 2021 +0100
+++ b/prosodyctl	Thu Jan 21 19:02:03 2021 +0100
@@ -79,7 +79,8 @@
 		return 1;
 	end
 	-- TODO finalize config option name
-	call_luarocks("install", arg[1], configmanager.get("*", "plugin_server") or "http://localhost/");
+	local ret = call_luarocks("install", arg[1], configmanager.get("*", "plugin_server") or "http://localhost/");
+	return ret;
 end
 
 function commands.remove(arg)
@@ -87,7 +88,8 @@
 		show_usage([[remove]], [[Removes a module installed in the working directory's plugins folder]]);
 		return 1;
 	end
-	call_luarocks("remove", arg[1])
+	local ret = call_luarocks("remove", arg[1]);
+	return ret;
 end
 
 function commands.list(arg)
@@ -95,7 +97,8 @@
 		show_usage([[list]], [[Shows installed rocks]]);
 		return 1;
 	end
-	call_luarocks("list", arg[1])
+	local ret = call_luarocks("list", arg[1]);
+	return ret;
 end
 
 function commands.adduser(arg)