aboutsummaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2018-07-04 23:15:07 +0200
committerHisham Muhammad <hisham@gobolinux.org>2018-07-04 18:15:07 -0300
commit410e3e057d41e08f497c770ce0576072e6b83fe7 (patch)
treed051850c5cecc874f85ff73136a21790fa41460a /src/bin
parentdc0c08a4fba646845ec7b00e9a5f24eecec5ff17 (diff)
downloadluarocks-410e3e057d41e08f497c770ce0576072e6b83fe7.tar.gz
luarocks-410e3e057d41e08f497c770ce0576072e6b83fe7.tar.bz2
luarocks-410e3e057d41e08f497c770ce0576072e6b83fe7.zip
cmd: dynamically load additional external commands
Instead of a fixed list of commands, a dynamic list of modules residing within the `luarocks.cmd.external.<cmd_name>` in the Lua path will be dynamically added. This allows extending LuaRocks with additional commands. Same for `luarocks.admin.cmd.external.<cmd_name>`.
Diffstat (limited to 'src/bin')
-rwxr-xr-xsrc/bin/luarocks5
-rwxr-xr-xsrc/bin/luarocks-admin2
2 files changed, 2 insertions, 5 deletions
diff --git a/src/bin/luarocks b/src/bin/luarocks
index d0df0532..18a6179b 100755
--- a/src/bin/luarocks
+++ b/src/bin/luarocks
@@ -1,8 +1,5 @@
1#!/usr/bin/env lua 1#!/usr/bin/env lua
2 2
3-- this should be loaded first.
4local cfg = require("luarocks.core.cfg")
5
6local loader = require("luarocks.loader") 3local loader = require("luarocks.loader")
7local cmd = require("luarocks.cmd") 4local cmd = require("luarocks.cmd")
8 5
@@ -33,4 +30,4 @@ local commands = {
33 test = "luarocks.cmd.test", 30 test = "luarocks.cmd.test",
34} 31}
35 32
36cmd.run_command(description, commands, ...) 33cmd.run_command(description, commands, "luarocks.cmd.external", ...)
diff --git a/src/bin/luarocks-admin b/src/bin/luarocks-admin
index e27b8c01..77a51872 100755
--- a/src/bin/luarocks-admin
+++ b/src/bin/luarocks-admin
@@ -13,4 +13,4 @@ local commands = {
13 refresh_cache = "luarocks.admin.cmd.refresh_cache", 13 refresh_cache = "luarocks.admin.cmd.refresh_cache",
14} 14}
15 15
16cmd.run_command(description, commands, ...) 16cmd.run_command(description, commands, "luarocks.admin.cmd.external", ...)