aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/fetch/git_file.lua
blob: 1b18d0fa176ade0e75dde96f963a1367b30633b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

--- Fetch back-end for retrieving sources from local Git repositories.
module("luarocks.fetch.git_file", package.seeall)

local git = require("luarocks.fetch.git")

--- Fetch sources for building a rock from a local Git repository.
-- @param rockspec table: The rockspec table
-- @param extract boolean: Unused in this module (required for API purposes.)
-- @param dest_dir string or nil: If set, will extract to the given directory.
-- @return (string, string) or (nil, string): The absolute pathname of
-- the fetched source tarball and the temporary directory created to
-- store it; or nil and an error message.
function get_sources(rockspec, extract, dest_dir)
   rockspec.source.url = rockspec.source.url:gsub("^git.file://", "")
   return git.get_sources(rockspec, extract, dest_dir)
end