|
| 1 | +#!/usr/bin/lua |
| 2 | +package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[/usr/local/etc/luarocks]], LUA_VERSION = "5.1" } |
| 3 | +package.path=[[/usr/local/share/lua/5.1/?.lua;]] .. package.path |
| 4 | +local list = package.searchers or package.loaders; table.insert(list, 1, function(name) if name:match("^luarocks%.") then return loadfile([[/usr/local/share/lua/5.1/]] .. name:gsub([[%.]], [[/]]) .. [[.lua]]) end end) |
| 5 | + |
| 6 | +-- Load cfg first so that the loader knows it is running inside LuaRocks |
| 7 | +local cfg = require("luarocks.core.cfg") |
| 8 | + |
| 9 | +local loader = require("luarocks.loader") |
| 10 | +local cmd = require("luarocks.cmd") |
| 11 | + |
| 12 | +local description = "LuaRocks main command-line interface" |
| 13 | + |
| 14 | +local commands = { |
| 15 | + init = "luarocks.cmd.init", |
| 16 | + pack = "luarocks.cmd.pack", |
| 17 | + unpack = "luarocks.cmd.unpack", |
| 18 | + build = "luarocks.cmd.build", |
| 19 | + install = "luarocks.cmd.install", |
| 20 | + search = "luarocks.cmd.search", |
| 21 | + list = "luarocks.cmd.list", |
| 22 | + remove = "luarocks.cmd.remove", |
| 23 | + make = "luarocks.cmd.make", |
| 24 | + download = "luarocks.cmd.download", |
| 25 | + path = "luarocks.cmd.path", |
| 26 | + show = "luarocks.cmd.show", |
| 27 | + new_version = "luarocks.cmd.new_version", |
| 28 | + lint = "luarocks.cmd.lint", |
| 29 | + write_rockspec = "luarocks.cmd.write_rockspec", |
| 30 | + purge = "luarocks.cmd.purge", |
| 31 | + doc = "luarocks.cmd.doc", |
| 32 | + upload = "luarocks.cmd.upload", |
| 33 | + config = "luarocks.cmd.config", |
| 34 | + which = "luarocks.cmd.which", |
| 35 | + test = "luarocks.cmd.test", |
| 36 | +} |
| 37 | + |
| 38 | +cmd.run_command(description, commands, "luarocks.cmd.external", ...) |
0 commit comments