Skip to content

Instantly share code, notes, and snippets.

@mascarenhas
Created October 26, 2009 19:59
Show Gist options
  • Save mascarenhas/218979 to your computer and use it in GitHub Desktop.
Save mascarenhas/218979 to your computer and use it in GitHub Desktop.
#!/usr/bin/env lua
-- Does a "luarocks make" with symlinks from your source tree instead of copying
-- Run with "lua luarocks_ln.lua make <rockspec>" at the root of the source tree
local command_line = require("luarocks.command_line")
local fs = require("luarocks.fs")
require "lfs"
fs.copy = function (src, dest)
if src:sub(1,1) ~= "/" then
src = lfs.currentdir() .. "/" .. src
end
if os.execute("ln -fs " .. src .. " " .. dest) == 0 then
return true
else
return false
end
end
fs.move = function (src, dest)
if os.execute("mv " .. src .. " " .. dest) == 0 then
return true
else
return false
end
end
program_name = "luarocks"
program_description = "LuaRocks main command-line interface"
commands = {}
commands.help = require("luarocks.help")
commands.make = require("luarocks.make")
command_line.run_command(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment