diff options
| -rw-r--r-- | src/luarocks/fs/lua.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index c413ccb3..24b05a59 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
| @@ -669,13 +669,18 @@ function check_command_permissions(flags) | |||
| 669 | local root_dir = path.root_dir(cfg.rocks_dir) | 669 | local root_dir = path.root_dir(cfg.rocks_dir) |
| 670 | local ok = true | 670 | local ok = true |
| 671 | local err = "" | 671 | local err = "" |
| 672 | for _, dir in ipairs { cfg.rocks_dir, root_dir, dir.dir_name(root_dir) } do | 672 | for _, dir in ipairs { cfg.rocks_dir, root_dir } do |
| 673 | if fs.exists(dir) and not fs.is_writable(dir) then | 673 | if fs.exists(dir) and not fs.is_writable(dir) then |
| 674 | ok = false | 674 | ok = false |
| 675 | err = "Your user does not have write permissions in " .. dir | 675 | err = "Your user does not have write permissions in " .. dir |
| 676 | break | 676 | break |
| 677 | end | 677 | end |
| 678 | end | 678 | end |
| 679 | local root_parent = dir.dir_name(root_dir) | ||
| 680 | if ok and not fs.exists(root_dir) and not fs.is_writable(root_parent) then | ||
| 681 | ok = false | ||
| 682 | err = root_dir.." does not exist and your user does not have write permissions in " .. root_parent | ||
| 683 | end | ||
| 679 | if ok then | 684 | if ok then |
| 680 | return true | 685 | return true |
| 681 | else | 686 | else |
