Fri, 23 Apr 2010 14:32:28 +0100
Support for LuaRocks (thanks albert!)
xmpp-fingerprint.lua | file | annotate | diff | comparison | revisions |
--- a/xmpp-fingerprint.lua Wed Apr 21 17:03:44 2010 +0100 +++ b/xmpp-fingerprint.lua Fri Apr 23 14:32:28 2010 +0100 @@ -1,6 +1,14 @@ #!/usr/bin/env lua -local socket = require "socket"; +function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else +return nil, lib; end end + +-- Required to be able to find packages installed with luarocks +if not softreq "luarocks.loader" then -- LuaRocks 2.x + softreq "luarocks.require"; -- LuaRocks <1.x +end + +local socket = softreq "socket"; -- Defaults -- default_port = 5222;