From 410e3e057d41e08f497c770ce0576072e6b83fe7 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Wed, 4 Jul 2018 23:15:07 +0200 Subject: cmd: dynamically load additional external commands Instead of a fixed list of commands, a dynamic list of modules residing within the `luarocks.cmd.external.` in the Lua path will be dynamically added. This allows extending LuaRocks with additional commands. Same for `luarocks.admin.cmd.external.`. --- src/bin/luarocks | 5 +---- src/bin/luarocks-admin | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/bin') 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 @@ #!/usr/bin/env lua --- this should be loaded first. -local cfg = require("luarocks.core.cfg") - local loader = require("luarocks.loader") local cmd = require("luarocks.cmd") @@ -33,4 +30,4 @@ local commands = { test = "luarocks.cmd.test", } -cmd.run_command(description, commands, ...) +cmd.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 = { refresh_cache = "luarocks.admin.cmd.refresh_cache", } -cmd.run_command(description, commands, ...) +cmd.run_command(description, commands, "luarocks.admin.cmd.external", ...) -- cgit v1.2.3-55-g6feb