From d0a9e68a4125c043a6ee6a4d92ac244f2feb7ccb Mon Sep 17 00:00:00 2001
From: Hisham <hisham@gobolinux.org>
Date: Fri, 6 Jan 2017 17:44:35 -0200
Subject: Oops! Fix warning message.

---
 src/luarocks/command_line.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua
index 1ad99e7f..31948b33 100644
--- a/src/luarocks/command_line.lua
+++ b/src/luarocks/command_line.lua
@@ -187,7 +187,9 @@ function command_line.run_command(...)
       util.warning("The directory '" .. cfg.local_cache .. "' or its parent directory "..
                    "is not owned by the current user and the cache has been disabled. "..
                    "Please check the permissions and owner of that directory. "..
-                   "If executing pip with sudo, you may want sudo's -H flag.")
+                   (cfg.is_platform("unix")
+                    and ("If executing "..util.this_program("luarocks").." with sudo, you may want sudo's -H flag.")
+                    or ""))
       cfg.local_cache = fs.make_temp_dir("local_cache")
       util.schedule_function(fs.delete, cfg.local_cache)
    end
-- 
cgit v1.2.3-55-g6feb