diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/core/cfg.lua | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index b2b26fad..3c672693 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua | |||
| @@ -72,23 +72,16 @@ end | |||
| 72 | 72 | ||
| 73 | local function set_confdirs(cfg, platforms, hardcoded_sysconfdir) | 73 | local function set_confdirs(cfg, platforms, hardcoded_sysconfdir) |
| 74 | local sysconfdir = os.getenv("LUAROCKS_SYSCONFDIR") or hardcoded_sysconfdir | 74 | local sysconfdir = os.getenv("LUAROCKS_SYSCONFDIR") or hardcoded_sysconfdir |
| 75 | local windows_style = platforms.windows | 75 | if platforms.windows and not platforms.msys2_mingw_w64 then |
| 76 | if platforms.msys2_mingw_w64 then | ||
| 77 | windows_style = false | ||
| 78 | end | ||
| 79 | if windows_style then | ||
| 80 | cfg.home = os.getenv("APPDATA") or "c:" | 76 | cfg.home = os.getenv("APPDATA") or "c:" |
| 81 | cfg.home_tree = cfg.home.."/luarocks" | 77 | cfg.home_tree = cfg.home.."/luarocks" |
| 82 | cfg.homeconfdir = cfg.home_tree | 78 | cfg.homeconfdir = cfg.home_tree |
| 83 | cfg.sysconfdir = sysconfdir or ((os.getenv("PROGRAMFILES") or "c:") .. "/luarocks") | 79 | cfg.sysconfdir = sysconfdir or ((os.getenv("PROGRAMFILES") or "c:") .. "/luarocks") |
| 84 | else | 80 | else |
| 85 | if not sysconfdir then | ||
| 86 | sysconfdir = detect_sysconfdir() | ||
| 87 | end | ||
| 88 | cfg.home = os.getenv("HOME") or "" | 81 | cfg.home = os.getenv("HOME") or "" |
| 89 | cfg.home_tree = cfg.home.."/.luarocks" | 82 | cfg.home_tree = cfg.home.."/.luarocks" |
| 90 | cfg.homeconfdir = cfg.home_tree | 83 | cfg.homeconfdir = cfg.home_tree |
| 91 | cfg.sysconfdir = sysconfdir or "/etc/luarocks" | 84 | cfg.sysconfdir = sysconfdir or detect_sysconfdir() or "/etc/luarocks" |
| 92 | end | 85 | end |
| 93 | end | 86 | end |
| 94 | 87 | ||
