diff options
Diffstat (limited to 'src/luarocks/install.lua')
| -rw-r--r-- | src/luarocks/install.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index 4bb073dc..f9f27ccf 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua | |||
| @@ -107,14 +107,14 @@ function run(...) | |||
| 107 | return nil, "Argument missing, see help." | 107 | return nil, "Argument missing, see help." |
| 108 | end | 108 | end |
| 109 | 109 | ||
| 110 | if not flags["local"] and not fs.is_writable(cfg.root_dir) then | 110 | if not flags["local"] and (fs.exists(cfg.root_dir) and not fs.is_writable(cfg.root_dir)) then |
| 111 | return nil, "Your user does not have write permissions in " .. cfg.root_dir .. | 111 | return nil, "Your user does not have write permissions in " .. cfg.root_dir .. |
| 112 | " \n-- you may want to run as a privileged user or use your local tree with --local." | 112 | " \n-- you may want to run as a privileged user or use your local tree with --local." |
| 113 | end | 113 | end |
| 114 | 114 | ||
| 115 | if name:match("%.rockspec$") or name:match("%.src%.rock$") then | 115 | if name:match("%.rockspec$") or name:match("%.src%.rock$") then |
| 116 | local build = require("luarocks.build") | 116 | local build = require("luarocks.build") |
| 117 | return build.run(name) | 117 | return build.run(name, flags["local"] and "--local") |
| 118 | elseif name:match("%.rock$") then | 118 | elseif name:match("%.rock$") then |
| 119 | return install_binary_rock(name) | 119 | return install_binary_rock(name) |
| 120 | else | 120 | else |
