From 26b22259dd5e9380a38e06577345918885eb5707 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 14 Mar 2019 21:49:29 -0300 Subject: init: support running from the root directory Containers often run things from the root directory. This makes the argument mandatory when running `luarocks init` from `/`. See https://github.com/luarocks/luarocks/issues/952#issuecomment-456528919 --- src/luarocks/cmd/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/luarocks/cmd/init.lua b/src/luarocks/cmd/init.lua index e2dddc09..28c6f5d5 100644 --- a/src/luarocks/cmd/init.lua +++ b/src/luarocks/cmd/init.lua @@ -57,6 +57,9 @@ function init.command(flags, name, version) if not name then name = dir.base_name(pwd) + if name == "/" then + return nil, "When running from the root directory, please specify the argument" + end end util.printout("Initializing project " .. name .. " ...") -- cgit v1.2.3-55-g6feb