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 | c7a3bb48c45e760460bad4466ffec1340a2d98cc (patch) | |
| tree | f3c629de8afda178716d81e9ff7a5f1995cce03b /src | |
| parent | 408e8dc33faaf90e616564a880f7594ee68a6b32 (diff) | |
| download | luarocks-c7a3bb48c45e760460bad4466ffec1340a2d98cc.tar.gz luarocks-c7a3bb48c45e760460bad4466ffec1340a2d98cc.tar.bz2 luarocks-c7a3bb48c45e760460bad4466ffec1340a2d98cc.zip | |
Teal: convert luarocks.fetch.hg_http
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fetch/hg_http.tl (renamed from src/luarocks/fetch/hg_http.lua) | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/luarocks/fetch/hg_http.lua b/src/luarocks/fetch/hg_http.tl index 8f506daf..a4ce48fd 100644 --- a/src/luarocks/fetch/hg_http.lua +++ b/src/luarocks/fetch/hg_http.tl | |||
| @@ -5,10 +5,13 @@ | |||
| 5 | -- `hg clone http://example.com/foo` | 5 | -- `hg clone http://example.com/foo` |
| 6 | -- you can use this in the rockspec: | 6 | -- you can use this in the rockspec: |
| 7 | -- source = { url = "hg+http://example.com/foo" } | 7 | -- source = { url = "hg+http://example.com/foo" } |
| 8 | local hg_http = {} | 8 | local record hg_http |
| 9 | end | ||
| 9 | 10 | ||
| 10 | local hg = require("luarocks.fetch.hg") | 11 | local hg = require("luarocks.fetch.hg") |
| 11 | 12 | ||
| 13 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec | ||
| 14 | |||
| 12 | --- Download sources for building a rock, using hg over http. | 15 | --- Download sources for building a rock, using hg over http. |
| 13 | -- @param rockspec table: The rockspec table | 16 | -- @param rockspec table: The rockspec table |
| 14 | -- @param extract boolean: Unused in this module (required for API purposes.) | 17 | -- @param extract boolean: Unused in this module (required for API purposes.) |
| @@ -16,7 +19,7 @@ local hg = require("luarocks.fetch.hg") | |||
| 16 | -- @return (string, string) or (nil, string): The absolute pathname of | 19 | -- @return (string, string) or (nil, string): The absolute pathname of |
| 17 | -- the fetched source tarball and the temporary directory created to | 20 | -- the fetched source tarball and the temporary directory created to |
| 18 | -- store it; or nil and an error message. | 21 | -- store it; or nil and an error message. |
| 19 | function hg_http.get_sources(rockspec, extract, dest_dir) | 22 | function hg_http.get_sources(rockspec: Rockspec, extract: boolean, dest_dir?: string): string, string |
| 20 | rockspec.source.url = rockspec.source.url:gsub("^hg.", "") | 23 | rockspec.source.url = rockspec.source.url:gsub("^hg.", "") |
| 21 | return hg.get_sources(rockspec, extract, dest_dir) | 24 | return hg.get_sources(rockspec, extract, dest_dir) |
| 22 | end | 25 | end |
