Skip to content

Commit

Permalink
Add -f flag to curl, to improve error handling, as suggested in #244.
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Mar 31, 2014
1 parent 0842090 commit 489b990
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/luarocks/fs/unix/tools.lua
Expand Up @@ -259,7 +259,7 @@ function tools.download(url, filename, cache)
ok = fs.execute(wget_cmd, url)
end
elseif cfg.downloader == "curl" then
ok = fs.execute_string(vars.CURL.." -L --user-agent '"..cfg.user_agent.." via curl' "..fs.Q(url).." 2> /dev/null 1> "..fs.Q(filename))
ok = fs.execute_string(vars.CURL.." -f -L --user-agent '"..cfg.user_agent.." via curl' "..fs.Q(url).." 2> /dev/null 1> "..fs.Q(filename))
end
if ok then
return true, filename
Expand Down
2 changes: 1 addition & 1 deletion src/luarocks/fs/win32/tools.lua
Expand Up @@ -269,7 +269,7 @@ function tools.download(url, filename, cache)
ok = fs.execute(wget_cmd..fs.Q(url).." 2> NUL 1> NUL")
end
elseif cfg.downloader == "curl" then
ok = fs.execute_string(fs.Q(vars.CURL).." -L --user-agent \""..cfg.user_agent.." via curl\" "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename))
ok = fs.execute_string(fs.Q(vars.CURL).." -f -L --user-agent \""..cfg.user_agent.." via curl\" "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename))
end
if ok then
return true, filename
Expand Down

0 comments on commit 489b990

Please sign in to comment.