diff options
author | daurnimator <quae@daurnimator.com> | 2019-05-05 14:08:05 +1000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-05-06 11:43:12 -0300 |
commit | ea1e427c00753483fd5583140c8960b80bccc69b (patch) | |
tree | 181187cc7569a049f84fc5d0cebdf4595d1d28bf /src | |
parent | 33b00b4b526c8e0210ac6ce7cf40d3eb5f9b2278 (diff) | |
download | luarocks-ea1e427c00753483fd5583140c8960b80bccc69b.tar.gz luarocks-ea1e427c00753483fd5583140c8960b80bccc69b.tar.bz2 luarocks-ea1e427c00753483fd5583140c8960b80bccc69b.zip |
fix: don't try to look in home_tree if not available
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cmd.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 61e44a6e..b2f036bf 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -156,10 +156,11 @@ local function get_lua_version(flags) | |||
156 | if flags["lua-version"] then | 156 | if flags["lua-version"] then |
157 | return flags["lua-version"] | 157 | return flags["lua-version"] |
158 | end | 158 | end |
159 | local dirs = { | 159 | local dirs = {} |
160 | dir.path(cfg.home_tree, ".luarocks"), | 160 | if cfg.home_tree then |
161 | cfg.sysconfdir, | 161 | dirs[1] = dir.path(cfg.home_tree, ".luarocks") |
162 | } | 162 | end |
163 | table.insert(dirs, cfg.sysconfdir) | ||
163 | if flags["project-tree"] then | 164 | if flags["project-tree"] then |
164 | table.insert(dirs, 1, dir.path(flags["project-tree"], "..", ".luarocks")) | 165 | table.insert(dirs, 1, dir.path(flags["project-tree"], "..", ".luarocks")) |
165 | end | 166 | end |