Skip to content

Commit

Permalink
The make command now supports a --path=dir flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedonovan committed Oct 12, 2010
1 parent f3a33fb commit 8d60555
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/luarocks/make.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ function run(...)
" \n-- you may want to run as a privileged user or use your local tree with --local."
end

if flags["path"] then
local path = flags["path"]
if not fs.is_dir(path) then
return nil, "unable to change directory to "..path
end
fs.change_dir(path)
end

if not rockspec then
local files = fs.list_dir(fs.current_dir())
for _, file in pairs(files) do
Expand All @@ -56,5 +64,9 @@ function run(...)
return nil, "Invalid argument: 'make' takes a rockspec as a parameter. See help."
end

return build.build_rockspec(rockspec, false, true)
local res,err = build.build_rockspec(rockspec, false, true)
if flags['path'] then
fs.pop_dir()
end
return res,err
end

0 comments on commit 8d60555

Please sign in to comment.