diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-17 16:13:49 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-18 11:24:07 -0300 |
commit | 491bf90358162dec2b4ca0a03d6fa98552968ddc (patch) | |
tree | 9963a21a8e629cdc814c30568c26f855960a2787 /src | |
parent | ced4ee3b7d5d60f896bdf33a6013ae2776a72d86 (diff) | |
download | luarocks-491bf90358162dec2b4ca0a03d6fa98552968ddc.tar.gz luarocks-491bf90358162dec2b4ca0a03d6fa98552968ddc.tar.bz2 luarocks-491bf90358162dec2b4ca0a03d6fa98552968ddc.zip |
cmd: only detect sysconfdir on Unix
On the Windows single-binary this produces a weird "src/" path.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/core/cfg.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index cfbbd144..2606291c 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua | |||
@@ -66,15 +66,15 @@ end | |||
66 | 66 | ||
67 | local function set_confdirs(cfg, platforms, hardcoded_sysconfdir) | 67 | local function set_confdirs(cfg, platforms, hardcoded_sysconfdir) |
68 | local sysconfdir = os.getenv("LUAROCKS_SYSCONFDIR") or hardcoded_sysconfdir | 68 | local sysconfdir = os.getenv("LUAROCKS_SYSCONFDIR") or hardcoded_sysconfdir |
69 | if not sysconfdir then | ||
70 | sysconfdir = detect_sysconfdir(cfg.lua_version) | ||
71 | end | ||
72 | if platforms.windows then | 69 | if platforms.windows then |
73 | cfg.home = os.getenv("APPDATA") or "c:" | 70 | cfg.home = os.getenv("APPDATA") or "c:" |
74 | cfg.home_tree = cfg.home.."/luarocks" | 71 | cfg.home_tree = cfg.home.."/luarocks" |
75 | cfg.homeconfdir = cfg.home_tree | 72 | cfg.homeconfdir = cfg.home_tree |
76 | cfg.sysconfdir = sysconfdir or ((os.getenv("PROGRAMFILES") or "c:") .. "/luarocks") | 73 | cfg.sysconfdir = sysconfdir or ((os.getenv("PROGRAMFILES") or "c:") .. "/luarocks") |
77 | else | 74 | else |
75 | if not sysconfdir then | ||
76 | sysconfdir = detect_sysconfdir(cfg.lua_version) | ||
77 | end | ||
78 | cfg.home = os.getenv("HOME") or "" | 78 | cfg.home = os.getenv("HOME") or "" |
79 | cfg.home_tree = (os.getenv("USER") ~= "root") and cfg.home.."/.luarocks" | 79 | cfg.home_tree = (os.getenv("USER") ~= "root") and cfg.home.."/.luarocks" |
80 | cfg.homeconfdir = cfg.home.."/.luarocks" | 80 | cfg.homeconfdir = cfg.home.."/.luarocks" |