diff options
author | V1K1NGbg <victor@ilchev.com> | 2024-08-22 17:49:05 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-10-21 13:30:51 -0300 |
commit | 1286ee558e3cfb4ca0a3d26292eeb53d06e619e2 (patch) | |
tree | 635f2eaee35fdeb2a9e2ae776bf2c9d092295b6d /src | |
parent | 619b85008bafdeb1e12a214a5f0161e035bfb84f (diff) | |
download | luarocks-1286ee558e3cfb4ca0a3d26292eeb53d06e619e2.tar.gz luarocks-1286ee558e3cfb4ca0a3d26292eeb53d06e619e2.tar.bz2 luarocks-1286ee558e3cfb4ca0a3d26292eeb53d06e619e2.zip |
Teal: convert luarocks.fetch.git_http
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fetch/git_http.tl (renamed from src/luarocks/fetch/git_http.lua) | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/luarocks/fetch/git_http.lua b/src/luarocks/fetch/git_http.tl index d85e2572..4ff602d9 100644 --- a/src/luarocks/fetch/git_http.lua +++ b/src/luarocks/fetch/git_http.tl | |||
@@ -7,10 +7,13 @@ | |||
7 | -- source = { url = "git+http://example.com/foo.git" } | 7 | -- source = { url = "git+http://example.com/foo.git" } |
8 | -- Prefer using the normal git:// fetch mode as it is more widely | 8 | -- Prefer using the normal git:// fetch mode as it is more widely |
9 | -- available in older versions of LuaRocks. | 9 | -- available in older versions of LuaRocks. |
10 | local git_http = {} | 10 | local record git_http |
11 | end | ||
11 | 12 | ||
12 | local git = require("luarocks.fetch.git") | 13 | local git = require("luarocks.fetch.git") |
13 | 14 | ||
15 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec | ||
16 | |||
14 | --- Fetch sources for building a rock from a local Git repository. | 17 | --- Fetch sources for building a rock from a local Git repository. |
15 | -- @param rockspec table: The rockspec table | 18 | -- @param rockspec table: The rockspec table |
16 | -- @param extract boolean: Unused in this module (required for API purposes.) | 19 | -- @param extract boolean: Unused in this module (required for API purposes.) |
@@ -18,7 +21,7 @@ local git = require("luarocks.fetch.git") | |||
18 | -- @return (string, string) or (nil, string): The absolute pathname of | 21 | -- @return (string, string) or (nil, string): The absolute pathname of |
19 | -- the fetched source tarball and the temporary directory created to | 22 | -- the fetched source tarball and the temporary directory created to |
20 | -- store it; or nil and an error message. | 23 | -- store it; or nil and an error message. |
21 | function git_http.get_sources(rockspec, extract, dest_dir) | 24 | function git_http.get_sources(rockspec: Rockspec, extract: boolean, dest_dir?: string): string, string |
22 | rockspec.source.url = rockspec.source.url:gsub("^git.", "") | 25 | rockspec.source.url = rockspec.source.url:gsub("^git.", "") |
23 | return git.get_sources(rockspec, extract, dest_dir, "--") | 26 | return git.get_sources(rockspec, extract, dest_dir, "--") |
24 | end | 27 | end |