From abac98ae19ec838e4a301a65c76bdc236047d641 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 25 Oct 2013 19:29:34 -0200 Subject: Use a more idiomatic Windows path for the local caches --- src/luarocks/cfg.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 019d9293..2da72db0 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -316,7 +316,13 @@ if detected.windows then defaults.export_lua_path = "SET LUA_PATH=%s" defaults.export_lua_cpath = "SET LUA_CPATH=%s" defaults.wrapper_suffix = ".bat" - defaults.local_cache = home.."/cache/luarocks" + + local localappdata = os.getenv("LOCALAPPDATA") + if not localappdata then + -- for Windows versions below Vista + localappdata = os.getenv("USER_PROFILE").."/Local Settings/Application Data" + end + defaults.local_cache = localappdata.."/LuaRocks/Cache" end if detected.mingw32 then -- cgit v1.2.3-55-g6feb